引用字符串或者使用字符串函数
注意,在C++中,#include<string>与#include<ctring>和#include<string.h>是不一样的。
#include<string>
#include<ctring>
#include<string.h>
使用C中的字符串函数比如strlen(),需要引入的是#include<ctring>或者#include<string.h>
使用字符串变量比如string str = "abc",需要引入的是#include<string>
string str = "abc"