编写函数fun,通过指针实现将一个字符串反向。要求主函数输入字符串,通过调用函数fun实现输入字符串反向

日期:2011-11-01 22:55:50 人气:1

编写函数fun,通过指针实现将一个字符串反向。要求主函数输入字符串,通过调用函数fun实现输入字符串反向

12345abcde edcba54321 Press any key to continue #include #include "string.h" void fun(char *buf) { char str[100]="\0"; int i,j=0; for (i=strlen(buf)-1;i>=0;i--) str[j++]=buf[i]; printf("%s\n",str
    A+
热门评论