Vidyalelo
C++ Programming · Q78

Pointers and References in C++

Programming · C++ Programming · question 78

Q78

What will happen in the following C++ code snippet? int a = 100, b = 200; int *p = &a, *q = &b; p = q;

A.
b is assigned to a
B.
p now points to b
Answer
C.
a is assigned to b
D.
q now points to a

Answer: Option B

Solution

Answer: Option B
No explanation is given for this question Let's Discuss on Board