小编Nnp*_*Nnp的帖子

简单使用c ++ string length()函数不编译

我在Eclipse中用c ++做了一个非常基本的std :: string用法,并且无法弄清楚为什么它不起作用.

示例代码:

std::string str = "hello";
cout << str << ":" str.length();
Run Code Online (Sandbox Code Playgroud)

代码未编译时出现以下错误: Method 'length' could not be resolved

为什么?

c++ eclipse string

-3
推荐指数
1
解决办法
417
查看次数

标签 统计

c++ ×1

eclipse ×1

string ×1