#include #include #include int main() { int i; int n; char *q = "I am a coder"; n = strlen(q); char buffer[n+1];//多一个位置放'\0' printf("The string is:%s\n",q); for( i = 0;i { buffer[n-1-i]=*q++; } buffer[n]='\0'; printf("The ending string is:%s\n",buffer); return 0; }