C++ : string 的注意事项

C++的 striing 类中 ,  size()成员函数的返回类型为   string::size_type  , 为了程序的可移植性 , 避免用其他类型来代替该类型

1 string      str("hahahahha");
2 string::size_type len = str.size();
3 cout<<len<<endl;
原文地址:https://www.cnblogs.com/wowk/p/3126728.html