References


  1. What does a reference provide?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: A

    Because we are pointing memory address using the temp variable.


  1. What is the output of this program?
    #include 
    using namespace std;
    int main()
    {
    int num = 11;
    int & numref = num;
    num++;
    cout << "The value of num is " << numref;
    return 0;
    }











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: A

    The value is declared and it isincrementedrement, so it’s value is 11.



  1. What is the output of this program?
    #include 
    using namespace std;
    void print (char * str)
    {
    cout << str << endl;
    }
    int main ()
    {
    const char * str = "Interview Mania";
    print(const_cast (str) );
    return 0;
    }











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: C

    In this program we used the concept of constant casting to cast the variable and printing it.


  1. Identify the correct sentence regarding inequality between reference and pointer.











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: B

    we can not create the array of reference



  1. Pick out the correct statement.











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: C

    The NULL pointer dereference occurs where a pointer that is expected to be a valid address but instead is equal to NULL