Question: (1) whats wrong with line 3? (2) whats wrong with the constructors? (3) whats wrong with the function setC()? (4) whats wrong with the destructor?
1 class A 2 private: 3 int a = 1, b, c, d, *ptr; 4 public: A) int ptrnew int [10) ) A(int b0) this->b(b) I) void setA (int x) const axi void setB(int x) this.b x; ) void setC() { this->c = ptr [0]; } void setD (int x) d xi ) A (int *x) ( 9 10 delete ptr; 12 13 1 4 15 16 void main() 17 const A al; 18 A a2 (1, 2, 3) 19 al.setD (6) 20 cout
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
