编译错误说it
没有在这个范围内声明,它没有命名类型,预期;
#include <iostream>
#include <vector>
using namespace std;
int main()
{
vector<int> vec;
vec.push_back(1);
vec.push_back(3);
vec.push_back(5);
for (auto it = vec.begin(); it != vec.end(); ++it) {
cout << *it << endl;
}
cout << "size: " << vec.size() << endl;
return 0;
}