也许是这样的?
char *str_reverse_in_place(char *str, int len) { char *p1 = str; char *p2 = str + len - 1; while (p1 < p2) { char tmp = *p1; *p1++ = *p2; *p2-- = tmp; } return str; }