Your code snippet can be shortened tux...here it goes:
void reverse(char p[])
{
int len=strlen(p);
for(int i=len-1, j=0;j<i; i--, j++)
{
// exchange elements
p[i]^=p[j]^=p[i]^=p[j];
}
}
Try it and do tell me what do you think...???