Select chapter



functions (3.papers)
loops (1.papers)
arrays (2.papers)
structures (3.papers)
unions (1.papers)
pointers (7.papers)
null pointers (1.papers)
strings (2.papers)
misc c concepts (1.papers)
Data structures (5.papers)
linked lists (3.papers)
trees (1.papers)
basics (5.papers)
Hide

Sponsored Links


  

c pointers interview questions and answers

Show Answer
Share Facebook gmail Twitter
Show Answer
Share Facebook gmail Twitter
Show Answer
Share Facebook gmail Twitter
Show Answer
Share Facebook gmail Twitter
5
what does this declaration say?

void (*comp)();
  1. invalid declaration
  2. pointer to a function which returns nothing.
  3. function returning void *.
  4. none of the above
Show Answer
Share Facebook gmail Twitter
6
what does this declaration say?

void *comp(); 
  1. invalid declaration
  2. pointer to a function which returns nothing.
  3. function returning void *.
  4. none of the above
Show Answer
Share Facebook gmail Twitter
Show Answer
Share Facebook gmail Twitter
Show Answer
Share Facebook gmail Twitter
Show Answer
Share Facebook gmail Twitter
Show Answer
Share Facebook gmail Twitter
Show Answer
Share Facebook gmail Twitter
Show Answer
Share Facebook gmail Twitter
Show Answer
Share Facebook gmail Twitter
14
what is p2 in below declaration?

int * p1, p2; 
  1. p2 is a pointer to an int
  2. p2 is a variable of int type
  3. compilation error.
  4. p2 is a pointer to an int pointer.
Show Answer
Share Facebook gmail Twitter
15
What is the output of below C program?

#include  <stdio.h>
typedef int *intptr;

int main(void)
{
    intptr p,q;
    p = malloc(sizeof(int));
    q = malloc(sizeof(int));
    *p = 10;
    *q = 20;
    printf("%d %d", *p, *q);
    return 0;
}
  1. it will print addresses of pointers p & q.
  2. it prints 10, 20.
  3. it may print some garbage, or may crash.
  4. it gives compile time error, invalid pointer type declaration.
Show Answer
Share Facebook gmail Twitter
Show Answer
Share Facebook gmail Twitter
17
What is i in below declaration?

int * const i;
  1. i is a pointer to an integer constant.
  2. i is a constant pointer to a constant integer.
  3. invalid declaration, compile time error.
  4. i is a constant pointer to an integer.
Show Answer
Share Facebook gmail Twitter
Show Answer
Share Facebook gmail Twitter
19
what is below declaration?

char (*(*x())[]) ();
  1. x is function returning pointer to array of 
    pointer to function returning char.
  2. x is function returning pointer to a function returning char array.
  3. x is function returning array of 
    pointers to function returning char.
  4. x is function returning pointer to array of 
    pointer to function returning char pointer.
Show Answer
Share Facebook gmail Twitter
20
what does below declaration say?

char (*(*x[3])()) [5];
  1. x is array of 3 pointers to functions returning 
    array [5] of characters pointers.
  2. x is array of 3 pointers to functions returning 
    pointer to array [5] of characters pointers.
  3. x is array of 3 pointers to functions returning 
    pointer to array [5] of characters pointers which returns a function pointer.
  4. x is array of 3 pointers to functions returning 
    pointer to array [5] of characters.
Show Answer
Share Facebook gmail Twitter
Read more papers :