字符串是C++程序员在很多程序开发中必须处理的东西。通常,你都会从文件,数据库中读取字符串,并且很多时候都要解析它们。线程-安全象征类对于这一点非常有用,因为程序员可以利用它来解析数据,例如:
// let's say the command line is "app.exe -f -unicode -read_from test.txt"
const char * strCommandLine = GetCommandLine();
// you want to tokenize: read each command line argument
// (-f, -unicode, -read_from, test.txt
虽然你可以采用C方式中函数,比如strtok,这里是我们为什么不采用这种方式的原因:
下载这一文件包,你就会很方便地处理各种字符串。