Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void reverse(char *str)
- {
- char *end = str;
- char tmp;
- if (str) {
- while (*end) end++;
- end--;
- while (str < end) {
- /* swap the character */
- tmp = *end;
- *str++ = *end;
- *end-- = tmp;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement