Question: C++ Question 9 What is wrong about the class constructor below? class My Class { private: int *ptr: public: MyClass() { ptr = new int
Question 9 What is wrong about the class constructor below? class My Class { private: int *ptr: public: MyClass() { ptr = new int [2]; ptr[1]= 300; ptr[3] = 999; }; ptr[O] must be the first element. Optr[3] does not exist; it is out of bound of the array. Optr[1] = 300; is not a legal statement. a and b are correct answers. O a and care correct answers
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
