home *** CD-ROM | disk | FTP | other *** search
/ C!T ROM 2 / ctrom_ii_b.zip / ctrom_ii_b / PROGRAM / C / SMALL_C / REVERSE.C < prev    next >
Text File  |  1987-10-04  |  256b  |  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.