char* ReverseWord(char* in) { char *p, *q, *r; char c; for (p = q = in; ;p++) { if ((*p == ' ') || !*p) { for (r = p - 1; q < r; q++, r--) { c = *r; *r = *q; *q = c; } q = p + 1; if (!*p) break; } } for (q = in, p--; q < p; q++, p--) { c = *q; *q = *p; *p = c; } return in; }