一个关于在头文件中vector的问题!
//iStack.h
#ifndef ISTACK_H
#define ISTACK_H
class iStack{
public:
iStack( int capacity)
: _stack( capacity), _top(0) {}
bool pop( int &value );
bool push( int value );
bool full();
bool empty();
void display();
int size();
private:
int _top;
vector<int> _stack;//总是在这里报错!看书这里并没有语法上的错误啊!
//error C2143: syntax error :missing ';'before '<'
//error C2501: 'vector' : missing storage-class
or type specifiers
//error C2059: syntax error : '<'
//error C2238: unexpected token(s) preceding ';'
};
#endif // ISTACK_H ///:~
请楼主,和各位大虾为小弟解释一下。谢了先!!