void final_reverse (char* p){
char *ptail , *phead, *ptemp;
char temp_char;
ptail = phead = ptemp = p;
while(1){
if(*(ptail) == ' ' || *(ptail) == '\0'){
ptemp = ptail-1;
while(phead<= ptemp){
temp_char = *phead;
*phead = *ptemp;
*ptemp = temp_char;
phead++;
ptemp--;
}
phead = ptail+1;
}
if(*(ptail) == '\0') break;
ptail++;
}
}