Skip to content

Instantly share code, notes, and snippets.

@XcqRomance
Created December 3, 2018 07:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save XcqRomance/5e7a4e352e8a6cfb009074d46e0fa618 to your computer and use it in GitHub Desktop.
Save XcqRomance/5e7a4e352e8a6cfb009074d46e0fa618 to your computer and use it in GitHub Desktop.
// 反转字符串
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