⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ptrdataclass.h

📁 C++编成数据结构与程序设计方法 D.S.Malk编著
💻 H
字号:

class pointerDataClass
{
public:
    void print() const;
      //Function to output the data stored in the array p.

    void insertAt(int index, int num);
      //Function to insert num into the array p at the
      //position specified by index.
      //If index is out of bounds, the program is terminated.
      //If index is within bounds, but greater than the index
      //of the last item in the list, num is added at the end
      //of the list.

    pointerDataClass(int size = 10);
      //Constructor
      //Creates an array of the size specified by the
      //parameter size; the default array size is 10.

    ~pointerDataClass();
      //Destructor
      //deallocates the memory space occupied by the array p.

    pointerDataClass (const pointerDataClass& otherObject);
      //Copy constructor

private:
    int maxSize; //variable to store the maximum size of p
    int length;  //variable to store the number elements in p
    int *p;      //pointer to an int array
};


⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -