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