STL初学者问题请教
我现在正在学习STL的使用,写了个简单的程序,如下:
但总是出现如下错误,程序在VS2005中编译的。
错误 1 error C2061: syntax error : identifier 'T'
错误 2 fatal error C1903: unable to recover from previous error(s); stopping compilation
我怀疑是VS2005的编译器哪里没有设置好,请不吝赐教.
程序代码:#include <iostream>
#include <string>
#include <list>
using namespace std;
int main (void)
{
list<string> Milkshakes;
list<string>::iteratorMilkshakeIterator;
Milkshakes.push_back("Chocolate");
Milkshakes.push_back("Strawberry");
Milkshakes.push_front("Lime");
Milkshakes.push_front("Vanilla");
//Vanilla,Lime,Chocolate,Strawberry,
// print the milkshakes
Milkshakes.push_front("TheMilkshake Menu");
Milkshakes.push_back("*** Thatsthe end ***");
for (MilkshakeIterator=Milkshakes.begin();
MilkshakeIterator!=Milkshakes.end();
++MilkshakeIterator)
{
// dereference the iteratorto get the element
cout<< *MilkshakeIterator<< endl;
}
return 0;
}
ror C1903: unable to recover from previous error(s); stopping compilation









