我在Eclipse中用c ++做了一个非常基本的std :: string用法,并且无法弄清楚为什么它不起作用.
示例代码:
std::string str = "hello"; cout << str << ":" str.length();
代码未编译时出现以下错误: Method 'length' could not be resolved
Method 'length' could not be resolved
为什么?
c++ eclipse string
c++ ×1
eclipse ×1
string ×1