我的电脑上报错,另一台电脑就能正常运行
#include <string>
#include <iostream>
using namespace std;
int main()
{
string test_string = "abc";
for (auto c : test_string)
cout << c << endl;
}
######报错信息
#include <string>
#include <iostream>
using namespace std;
int main()
{
string test_string = "abc";
for (auto c : test_string)
cout << c << endl;
}
######报错信息
auto和range-for都是C++11引入的新语法。你先确定你的编译器支持C++11标准,并且你打开了C++11的编译选项。