I don't understand why these error occur. Anything wrong with syntax? Please help me! Thank you very much!
btw: I use MS VC++ to compile these code.
Code:
#include <vector>
using std::vector;
using std::iterator;
int main()
{
vector<int> a(10, -1);
vector<int>::iterator b = a.begin();
return 0;
}
--------------------Configuration: a - Win32 Debug--------------------
Compiling...
a.cpp
E:\Study\Algorithm\try\a.cpp(10) : error C2653: 'vector<int,class std::allocator<int> >' : is not a class or namespace name
E:\Study\Algorithm\try\a.cpp(10) : error C2955: 'iterator' : use of class template requires template argument list
d:\program files\microsoft visual studio\vc98\include\utility(71) : see declaration of 'iterator'
E:\Study\Algorithm\try\a.cpp(10) : error C2514: 'std::iterator' : class has no constructors
d:\program files\microsoft visual studio\vc98\include\utility(71) : see declaration of 'iterator'
E:\Study\Algorithm\try\a.cpp(10) : error C2262: 'b' : cannot be destroyed
Error executing cl.exe.
a.obj - 4 error(s), 0 warning(s)