Subversion Repositories Kolibri OS

Rev

Go to most recent revision | Blame | Last modification | View Log | RSS feed

  1. #include <string.h>
  2.  
  3. char* strrev(char *p)
  4. {
  5.   char *q = p, *res = p, z;
  6.   while(q && *q) ++q; /* find eos */
  7.   for(--q; p < q; ++p, --q)
  8.   {
  9.         z = *p;
  10.         *p = *q;
  11.         *q = z;
  12.   }
  13.   return res;
  14. }
  15.