我编写了以下代码,其中我已经初始化了向量,并声明了向量。就像数组一样,但是它抛出了以下错误:
代码是:-
# include <iostream>
# include <vector>
using namespace std;
int main()
{
vector <int> v = {1,2,3,4,5};
vector <int> :: iterator it ;
it = v.begin();
cout<< (*it) <<endl;
return 0;
}
我收到的
我很难理解可供我使用的不同编译器。
我主要使用Xcode编写和编译,在Xcode的首选项中,有以下所有用于C++编译的选项:
C++语言方言:
C++98-std=c++98通过C++14-std=c++14
GNU++98-std=gnu++98通过GNU++14-std=gnu++14
C++标准库:
libstdc++ (GNU C++标准库)
libc++ (具有C++11支持的LLVM C++标准库)
1. Can someone explain what exactly all of that ^ is?
2. I understand that