Register Now

Login

Lost Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

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

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
c) a is assigned to b
d) q now points to a

Answer: b
Explanation: Assigning to reference changes the object to which the reference is bound.

Join The Discussion