Pointers


  1. What will be the output of the following C code?
     #include <stdio.h>
    int num = 0;
    void main()
    {
    int *p = #
    printf("%p\n", p);
    num++;
    printf("%p\n ", p);
    }











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: B

    Same memory address


  1. Which of the following does not initialize p to null (assuming variable declaration of n as int n=0;)?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: C

    int *p = &n;



  1. Which is an indirection operator among the following?











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: C

    *


  1. Comment on the following C statement.
    const int *p;











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: D

    You cannot change the value pointed by p



  1. What will be the output of the following C code?
    #include <stdio.h>
    int main()
    {
    int *p, n = 15;
    p = &n;
    *p += 10;
    printf("%d, %d\n", *p, n);
    }











  1. View Hint View Answer Discuss in Forum

    NA

    Correct Option: C

    25, 25