字符串交换
#include<stdio.h>#include<string.h>
int main()
{
char str[]="ABCD1234efgh";
int length=strlen(str);
char * p1=str;
char * p2=str+length-1;//这是什么意思?
while(p1 < p2)//字符串比较???
{
char c = *p1;//这交换的是神马
*p1 = *p2;
*p2 = c;
++p1;//指针后移?
--p2;//指针前移?
}
printf("str now is %s\n",str);
return 0;
}