insertvalue function in stack class is not calling when pointing by smartpointer class? please expai
- by user323422
template< class Type >
class cStack
{
Type *m_array;
int m_Top;
int m_Size;
public:cStack();
cStack(const Type&);
cStack(const cStack<Type> &);
bool Is_Full();
bool Is_Empty();
void InsertValue(const Type&);
void RemeoveValue();
~cStack();
};
template< class Type >
class Smartpointer
{
cStack<Type> *sPtr;
public: Smartpointer();
Smartpointer(const Type&);
Type* operator->();
Type& operator*();
};
int main()
{ Smartpointer<int> sptr(1);
sptr->InsertValue(2);//its not calling insertvalue
}
}