home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD2.mdf / c / compiler / small_c / byte_sc / reverse.c < prev    next >
Encoding:
C/C++ Source or Header  |  1987-10-04  |  256 b   |  16 lines

  1. #define NOCCARGC  /* no argument count passing */
  2. /*
  3. ** reverse string in place 
  4. */
  5. reverse(s) char *s; {
  6.   char *j;
  7.   int c;
  8.   j = s + strlen(s) - 1;
  9.   while(s < j) {
  10.     c = *s;
  11.     *s++ = *j;
  12.     *j-- = c;
  13.     }
  14.   }
  15.  
  16.