strtok program crashing

前端 未结 4 1970
旧时难觅i
旧时难觅i 2020-12-19 23:15

the program for strtok given on http://www.opengroup.org/onlinepubs/000095399/functions/strtok.html crashes everytime..

#include 
...
char *t         


        
4条回答
  •  甜味超标
    2020-12-19 23:52

    aJ said what is needed. My advice is avoid that ugly & unsafe strtok. You are using C++ so go ahead with std::string. You also can use Boost http://www.boost.org/doc/libs/1_43_0/libs/libraries.htm#String & http://www.boost.org/doc/libs/1_43_0/doc/html/string_algo.html . If you want a new string class, you may look at http://bstring.sourceforge.net/ .

提交回复
热议问题