09.6 strlen()和str.length()使用区别

转自:https://blog.csdn.net/xulecn/article/details/1418976 函数 二者都是求字符串的长度,但strlen( )的参数必须是char*  ;而 str.length( )是string类对象str调用的成员函数,因此它们用在不一样的地方;this   char* ch="asdfsafas";  string str="adfadf";  cout
相关文章
相关标签/搜索