Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void reverse(char *head)
- {
- char *start = head, *end = head;
- while(1)
- {
- if(*end == '\0')
- {
- end--;
- break;
- }
- end++;
- cout << *end << endl;
- }
- while(start != end)
- {
- char cTemp = *start;
- *start = *end;
- *end = cTemp;
- start++;
- end--;
- }
- cout << head << endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement