Question: Consider the following program segment. 1 class A { 2 private: 3 int a = 1, b, c, d *ptr: 4 public: 5 A() {

Consider the following program segment. 1 class A { 2 private: 3 int a = 1, b, c, d *ptr: 4 public: 5 A() { int ptr = new int[10]: } 6 A(int b = 0): this rightarrow b(b) {} 7 void set A (int x) const { a = x: } 8 void set B (int x) (this, b = x;) 9 void set C () { this rightarrow c = ptr [0];} 10 void setD (int x) (d = x;) 11 A (int x) { 12 delete ptr: 13 ptr = x: 14 } 15 16 void main () { 17 const A al: 18 A a2 (1, 2, 3): 19 al. Set D(6): 20 cout
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
