#include <iostream> char *change(char *str) { int length=strlen(str); int i; char flag; for(i=0;i<length/2;i++) { flag=str[length-1-i]; str[length-1-i]=str[i]; str[i]=flag; } return str; } void main() { char ch[6]="12345"; std::cout<<change(ch); getchar(); }