Home > Back-end >  The use of C constructor
The use of C constructor

Time:09-24

The class Array//vector
{
Public:
Array (int arraySize=10);//the constructor
Array (Array & amp; Init).//copy constructor
~ Array ();//destructors
Int getsize ();
//determine whether two arrays are equal, equal return, otherwise it returns a zero
Int operator==(Array & amp; Right);//overload "=="

Array & amp; Operator=(Array & amp; Right);
Array & amp; The operator + (Array & amp; Right);
Array & amp; Operator - (Array & amp; Right);
Void input ();
Void the output ();
Private:
Int size;
Int * PTR.
};
Problem: create an Array of class objects, using the default parameters, how to create?

CodePudding user response:

Array myArray on;
Or
* pMyArray Array=new Array ();

CodePudding user response:

Thank you
  • Related