登 录
char* Revert(char *source) { int length = strlen(source); int start = 0; int end = length - 1; while(start < end) { char temp ; temp = *(source + start); *(source + start) = *(source + end); *(source + end) = temp; start++; end --; } return source;
} int _tmain(int argc, _TCHAR* argv[]) { char * source = "Hello,world"; char *result = Revert(source); }
抱歉!评论已关闭.