Pointers


  1. The correct statement for a function that takes pointer to a float, a pointer to a pointer to a char and returns a pointer to a pointer to a integer is











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: B

    int ***fun(float*, char**)


  1. What is the output of this program?
    #include 
    using namespace std;
    int main()
    {
    int p = 3, q = 5, r = 13;
    int *array[ ] = {&p, &q, &r};
    cout << array[1];
    return 0;
    }












  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: E

    Array element cannot be address of auto variable. It can be address of static or extern variables.



  1. What will happen in this code?
    int n = 50, m = 50;
    int *ptr = &n, *ptr0 = &m;
    ptr = ptr0;












  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: A

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


  1. Which of the following is illegal?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: C

    dp is initialized int value of i.



  1. Which one of the following is not a possible state for a pointer.











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: A

    A pointer can be in only 3 states a,b and c.