References


  1. Which is used to do the dereferencing?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: D

    Dereferencing is using a pointer with asterix. For example, *(abc).


  1. Pick out the correct option.











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: C

    References automatically dereference without needing an extra character



  1. What is the output of this program?
    #include <iostream>
    using namespace std;
    int main()
    {
    int num1, num2;
    int* Res;
    Res = &num1;
    num1 = 150;
    num2 = 100;
    *Res = 150;
    num2 = *Res;
    cout << *Res << " " << num2;
    return 0;
    }











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: C

    In this program, We are making the assignments and invoking the both num1 and num2 values as 150 by dereference operator.


  1. What is the output of this program?
    #include <iostream>
    using namespace std;
    int main()
    {
    int num;
    int *ptr;
    num = 12;
    ptr = #
    cout << *ptr;
    return 0;
    }











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: B

    In this program, we are copying the memory location of num into ptr and then printing the value in the address.



  1. What is the output of this program?
    #include <iostream>
    using namespace std;
    int main ()
    {
    int Num;
    int *PtrA;
    int **PtrB;
    Num = 1;
    PtrA = &Num;
    PtrB = &PtrA;
    cout << Num << "\n";
    cout << *PtrA << "\n";
    cout << *PtrB << "\n";
    cout << **PtrB << "\n";
    return 0;
    }











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: C

    In this program, We are printing the values and memory address
    by using the pointer and dereference operator.