Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Please using c++ to solve this Problem 10: For this problem, you will be asked t

ID: 3735772 • Letter: P

Question

Please using c++ to solve this

Problem 10: For this problem, you will be asked to write some code to accomplish a partiular task given the code fragment below. Each task may depend on the tasks that came before it. Your code must be syntactically class S public: S(int init) :m_num(init) () S() m_num() yotd setnt nuumu)) int get) f return u) private: b; S d1, d2(4), d3(-15); int num; 1, **Sp2, ***sp3; Set sp1 to point to d1 Using sp2 change the value of num in d1 to the value of num in d2 (you may not use d1). Using sp3 make sp1 point to d3 (you may not use sp1). What does the following code output? cout

Explanation / Answer

1)
   sp1 = &d1;

2)
   *sp2 = &d1;
   (*sp2)->set(d2.get());

3)
   **sp3 = sp1;

   **sp3 = &d3;

4)
   it will print the address of d3 variable