void rev_string(char str[])
{
char *p = str;

while(*p) p++;

while(--p > str) {
char temp = *p;
*p = *str;
*str++ = temp;
}
}