Home / CSE MCQs / C++ - MCQs :: Discussion

Discussion :: C++ - MCQs

  1. What will happen in this code?

         int a = 100, b = 200;

         int *p = &a, *q = &b;

         p = q;

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

    View Answer

    Workspace

    Answer : Option B

    Explanation :

    Assigning to refrence changes the object to which the refrence is bound.


Be The First To Comment