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

Question: Resolving Pointers in C++ Given the image above, fill in the code belo

ID: 3844287 • Letter: Q

Question

Question: Resolving Pointers in C++

Given the image above, fill in the code below with the correct symbols.



int_   a = ________;
int_   b = __ a;


int                            [ Select ]                       ["", "*", "&"]           a =                           [ Select ]                       ["3", "new int(3)"] ;


int                            [ Select ]                       ["", "*", "&"]           b =                           [ Select ]                       ["", "*", "&"]         a;

Explain why your answer is correct. I am not sure which choice would be correct. If * is required or & is selected, please explain why those are the correct symbols.

b 3 a 3

Explanation / Answer

int main () { int a = 3, b = 3; int * p1, * p2; p1 = &a; // p1 = address of a p2 = &b; // p2 = address of b *p1 = 10; // value pointed to by p1 = 10 *p2 = *p1; // value pointed to by p2 = value pointed to by p1 p1 = p2; // p1 = p2 (value of pointer is copied) *p1 = 20; // value pointed to by p1 = 20 cout
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote