2016-05-19 14:15:22 +02:00
|
|
|
#include <string.h>
|
|
|
|
|
2016-04-30 15:50:04 +02:00
|
|
|
char* strrev(char *p)
|
|
|
|
{
|
|
|
|
char *q = p, *res = p, z;
|
|
|
|
while(q && *q) ++q; /* find eos */
|
2016-05-19 14:15:22 +02:00
|
|
|
for(--q; p < q; ++p, --q)
|
|
|
|
{
|
2016-04-30 15:50:04 +02:00
|
|
|
z = *p;
|
|
|
|
*p = *q;
|
|
|
|
*q = z;
|
|
|
|
}
|
|
|
|
return res;
|
2016-05-19 14:15:22 +02:00
|
|
|
}
|