>>i have defined a stack class using single linked list and a template. as follow:
template <class T>
class genStack{
public:
void push(T a){.....}
T pop(){........}
....
....
private:
SLList<T>: lst;
}
i know when i want the stack to store int, i should declare a stack like this:
genStack<int> gs;
but i want to store defferent types (double,char...) of data in the same stack, how can i do that?