原本是想实现用strtok切割并输出各字串
#include<stdio.h>
#include<string.h>
int main()
{
char str[] ="arcd,deewrg-98r|rewe,fhfe-rdd4|5h32";
char *ch = strtok(str, ",-|");
while(ch != NULL)
{
printf("%s\n", ch);
ch = strtok(NULL, "-|,");
}
return 0;
}
在vscode上运行这段代码提示一下界面,使用debug后又出现死循环,该怎么改正?
使用debug后死循环信息: