这是VC++ 6。0的运行情况:
--------------------Configuration: Cpp1 - Win32 Debug--------------------
Compiling...
Cpp1.cpp
C:\Documents and Settings\Administrator\Templates\Cpp1.cpp(23) : error C2653: 'vector<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::allocator<class std::basic_string<char,struct std::char_traits<c
har>,class std::allocator<char> > > >' : is not a class or namespace name
C:\Documents and Settings\Administrator\Templates\Cpp1.cpp(23) : error C2955: 'iterator' : use of class template requires template argument list
d:\vc98\include\utility(71) : see declaration of 'iterator'
C:\Documents and Settings\Administrator\Templates\Cpp1.cpp(23) : error C2514: 'std::iterator' : class has no constructors
d:\vc98\include\utility(71) : see declaration of 'iterator'
C:\Documents and Settings\Administrator\Templates\Cpp1.cpp(23) : error C2262: 'iter1' : cannot be destroyed
C:\Documents and Settings\Administrator\Templates\Cpp1.cpp(24) : error C2653: 'vector<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::allocator<class std::basic_string<char,struct std::char_traits<c
har>,class std::allocator<char> > > >' : is not a class or namespace name
C:\Documents and Settings\Administrator\Templates\Cpp1.cpp(24) : error C2955: 'iterator' : use of class template requires template argument list
d:\vc98\include\utility(71) : see declaration of 'iterator'
C:\Documents and Settings\Administrator\Templates\Cpp1.cpp(24) : error C2514: 'std::iterator' : class has no constructors
d:\vc98\include\utility(71) : see declaration of 'iterator'
C:\Documents and Settings\Administrator\Templates\Cpp1.cpp(24) : error C2262: 'iter2' : cannot be destroyed
C:\Documents and Settings\Administrator\Templates\Cpp1.cpp(25) : error C2676: binary '++' : 'struct std::iterator' does not define this operator or a conversion to a type acceptable to the predefined operator
C:\Documents and Settings\Administrator\Templates\Cpp1.cpp(27) : error C2676: binary '!=' : 'struct std::iterator' does not define this operator or a conversion to a type acceptable to the predefined operator
C:\Documents and Settings\Administrator\Templates\Cpp1.cpp(27) : fatal error C1903: unable to recover from previous error(s); stopping compilation
Error executing cl.exe.
Cpp1.obj - 11 error(s), 0 warning(s)
下面是用C FREE 3.5的运行情况。
正在编译。。。。
正在连接。。。
完成构建::\progra~1\c-free~1.5\temp\untiteled3.cpp 0个错误,0个警告
生成。。。。。。。
这个编译器就没用问题,能够正确的得到结果
楼主说的那个问题 就是用 using 编译声明和编译指令应该是同样的效果才对啊 只是写法不同而已。
我想应该是编译器的问题吧