摘要: 方法1:#include<stdio.h>#include<string.h>int main(){char *src="hello,world";int len=strlen(src);char *dest=(char*)malloc(len+1); //要为\0分配空间char *p=dest;char *q=&src[len-1]; //指向最后一个字符while(len--!=0){*p++=*q--; //注意不要丢掉*号}p=0; //字符串尾部要加上\0printf("%s\n",de... 阅读全文
posted @ 2011-09-18 00:43 auleaf 阅读(5844) 评论(0) 推荐(0)