// *pch is a pointer to the beginning of a string while (*pch == ' ') pch++; char * ptemp = pch; while (*ptemp) ptemp++; while (*ptemp == ' ') ptemp--; *ptemp = 0;