1. Write a method to reverse a string in place (constant space and linear time).
Anonymous
void strrev(char *p) { char *q = p; while(q && *q) ++q; for(--q; p < q; ++p, --q) *p = *p ^ *q, *q = *p ^ *q, *p = *p ^ *q; }
Check out your Company Bowl for anonymous work chats.