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

Hi, easy question! Just need clarification! If two int pointers , pMyAge and pYo

ID: 663774 • Letter: H

Question

Hi, easy question! Just need clarification!

If two int pointers, pMyAge and pYourAge, both point to the same int, age, then the statement:

will have what impact if followed immediately by the following statements? (Only one correct choice).   It will:

A. cause onlycout << *pMyAge;

to display 7, but not

cout << *pYourAge;
B. cause onlycout << *pYourAge;

to display 7, but not

cout << *pMyAge;
C. cause bothcout << *pYourAge;

and

cout << *pMyAge;

to display 7.

D. cause bothcout << pYourAge;

and

cout << pMyAge;

to display 7.

Explanation / Answer

The answer is option (C) :

C. cause bothcout << *pYourAge;

and

cout << *pMyAge;

to display 7.

Because :

if it is pointing to same int it will print the same

7

it will print 7 only

Hope this helps

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