Home » C++ Programming » Pointers » Question
  1. What will happen in this code?
    int n = 50, m = 50;
    int *ptr = &n, *ptr0 = &m;
    ptr = ptr0;

    1. ptr now points to m
    2. m is assigned to n
    3. ptr0 now points to n
    4. n is assigned to m
    5. None of these
Correct Option: A

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



Your comments will be displayed only after manual approval.