2 #include<string.h>
3
4
5 void revert(char *s, int size)
6
7 {
8 char * p = s;
9 char * q = s+size-1;
10
11 while((q-p)>0){
12 char tmp = *p;
13 *p=*q;
14 *q = tmp;
15 p++;
16 q--;
17
18 }
19 }
20
21 int main()
22 {
23 char cc[] = "helloword\0";
24
25 printf("...........%s\n", cc);
26 revert(cc,strlen(cc));
27
28 printf("...........%s\n", cc);
29 return 1;
30 }