Skip to content

Instantly share code, notes, and snippets.

@jakeboxer
Created April 27, 2012 21:06
Show Gist options
  • Save jakeboxer/2513226 to your computer and use it in GitHub Desktop.
Save jakeboxer/2513226 to your computer and use it in GitHub Desktop.
C string reverse
void reverse(char txt[]) {
int i, j;
char tmp;
for (i = 0, j = strlen(txt) - 1; i < j; ++i, --j) {
tmp = txt[i];
txt[i] = txt[j];
txt[j] = tmp;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment