史上最坑的函数 --- strtok
-
p = strtok(src, ",");
-
-
if(p)
-
{
-
p = func();
-
}
-
-
p= strtok(NULL, ","); ---就这里,会产生异常返回结果的!
假如在 func() 中执行了 strtok(),如:
-
char * func()
-
{
-
p = strtok(str, "\");
-
}
-
则在主函数第8行再次执行strtok时候,会产生异常的返回结果哦!
反正该函数在可重入性和线程安全方面,严重不推荐。