相关疑难解决方法(0)

错误:请求'this'中的成员'..',这是非类型' - *const'

我这里的第一个问题.请原谅,我刚刚进入C++并开始使用DS.堆!!!

我的代码:我想

    using namespace std;
    typedef char stackElement;

    class Stack
    {
    public:
        stackElement *contents;   //dynamically allocated: as we do not know what would be the size of our array.
        int top, maxSize;               // current Top index in the array

                //max size of the array; we need it to know if the array is full

    Stack(int maxSize)
    {

        contents = new stackElement(maxSize);
        this.maxSize = maxSize;
        if(contents == NULL)
        {
            cout<<"Insufficient memory";
            exit(1);

        }

        top = -1;
    }
    ~Stack()
    {
        delete [] …
Run Code Online (Sandbox Code Playgroud)

c++

4
推荐指数
1
解决办法
7058
查看次数

标签 统计

c++ ×1