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
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.