求字符串长度 strlen就收的是一个 char * 参数
char* p1 = "abcd";
cout << strlen(p1);
输出结果:4
string a = "aasdf"; 不能用strlen()函数
cout << a.size();
求字符串长度 strlen就收的是一个 char * 参数
char* p1 = "abcd";
cout << strlen(p1);
输出结果:4
string a = "aasdf"; 不能用strlen()函数
cout << a.size();