出于某种原因,我在第一次使用strtok()时得到一个异常我想要完成的是一个函数,它只是检查子串在字符串中是否重复.但到目前为止我还没有开始工作
int CheckDoubleInput(char* input){ char* word = NULL; char cutBy[] = ",_"; word = strtok(input, cutBy); <--- **error line** /* walk through other tokens */ while (word != NULL) { printf(" %s\n", word); word = strtok(NULL, cutBy); } return 1; }
和主要调用功能:
CheckDoubleInput("asdlakm,_asdasd,_sdasd,asdas_sas");