用vc写STL程序需要VC的什么特别的设置吗?
小弟初学,还请各位大虾指导:
以下这段代码时教科书上的,可是在我的vc里面就是编译不了,各位大虾,究竟是真么回事啊?需要vc的环境进行什么设置吗?
谢谢!
#include <list>
#include <string>
#include <iostream>
using namespace std ;
typedef list<string> LISTSTR;
void main()
{
LISTSTR test;
test.push_back("back");
test.push_front("middle");
test.push_front("front");
// front
cout << test.front() << endl;
// back
cout << test.back() << endl;
test.pop_front();
test.pop_back();
// middle
cout << test.front() << endl;
}