char * left = str;//前面的指针,负责赋值 char * right = str;//后面寻找非空格字符的指针 while (*right)//截至字符串完 { if (*right != ' ') { if (left<right) { *left = *right;//赋值 } left++; } if (*right == ' '&&*(right + 1) != ' ')//寻找到下一个单词时,对lef...
char * left = str;//前面的指针,负责赋值 char * right = str;//后面寻找非空格字符的指针 while (*right)//截至字符串完 { if (*right != ' ') { if (left<right) { *left = *right;//赋值 } left++; } if (*right == ' '&&*(right + 1) != ' ')//寻找到下一个单词时,对lef...