Stack<Node> stack; //Gives Error.
Stack<Node<int>> stack; //gives Error. WHAT TO DO???
Error:
D:\VC 6.0\32\Expression Tree.cpp(163) : error C2955: 'Node' : use of class template requires template argument list
D:\VC 6.0\32\Expression Tree.cpp(11) : see declaration of 'Node'
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
////////////////////////////////////////////////////////////////////////////////
//``````````````````````````````````````````````````````````````````````````````
template <class T>
class Stack{
public:
Stack();
void push(T);
T pop();
bool isEmpty();
T getTop();
private:
struct Node{
Node(){}
Node(T v){ this->value = v; }
T value;
Node* next;
} *top;
};