如何从c中删除字符串中的第一个单词

Jam*_*mes 2 c

我有一串整数值.例如20 200 2000 21 1

我想删除第一个单词(在这种情况下为20).知道怎么做吗?

我想过用...

sscanf(str, "/*somehow put first word here*/ %s", str);
Run Code Online (Sandbox Code Playgroud)

Dru*_*erB 5

怎么样

char *newStr = str;
while (*newStr != 0 && *(newStr++) != ' ') {}
Run Code Online (Sandbox Code Playgroud)