Skip to content

Instantly share code, notes, and snippets.

@bryanwb
Created Mar 3, 2010
Embed
What would you like to do?
/* reverse: reverse string s in place */
void reverse(char *s)
{
int j = 0;
int temp = 0;
char *i = s;
s += strlen(s) - 1;
while (s != i){
temp = *i;
*i = *s;
*s = temp;
i++, s--;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment