Created
December 3, 2018 07:06
-
-
Save XcqRomance/f1d2a5d03bb941cae16c1486cf6ee1ce to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 反转字符串 | |
char* reverseString(char* s) { | |
int len=strlen(s); | |
int mid=len/2; | |
for(int i=0,j=len-1;i<mid,i<j;i++,j--){ | |
char tmp; | |
tmp=s[i]; | |
s[i]=s[j]; | |
s[j]=tmp; | |
} | |
return s; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment