pointerdataclass.h

来自「data+structures+using+c的源码」· C头文件 代码 · 共 31 行

H
31
字号
class pointerDataClass
{
public:
    void print() const;
		//Function to output the value of x and
		//the value of the array p
    void setData();
		//Function to input data into x and
		//into the array p
    void destroyP();
		//Function to deallocate the memory space 
		//occupied by the array p

    pointerDataClass(int sizeP = 10);
		//constructor 
		//Creates an array of the size specified by the
		//parameter sizeP; 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 x;
    int lenP;
    int *p;		//pointer to an int array
};

⌨️ 快捷键说明

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