Skip to content

Instantly share code, notes, and snippets.

@JasonGitHub
Last active December 13, 2015 21:09
Show Gist options
  • Select an option

  • Save JasonGitHub/4975304 to your computer and use it in GitHub Desktop.

Select an option

Save JasonGitHub/4975304 to your computer and use it in GitHub Desktop.
void ReverseString(char* str, int n) {
char* end = str + n - 1;
while (str < end) {
swap(*str, *end);
++str;
--end;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment