insertvalue function in stack class is not calling when pointing by smartpointer class? please expai

Posted by user323422 on Stack Overflow See other posts from Stack Overflow or by user323422
Published on 2010-04-27T07:44:02Z Indexed on 2010/04/27 7:53 UTC
Read the original article Hit count: 133

Filed under:
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

}

}

© Stack Overflow or respective owner

Related posts about c++