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
Show Answer
Share Facebook gmail Twitter
Show Answer
Share Facebook gmail Twitter
7
What is the return value of malloc?
  1. malloc always returns a valid memory address.
  2. malloc returns valid address, but if it fails it may return null.
  3. malloc returns int size which says how many bytes it has allocated.
  4. none
Show Answer
Share Facebook gmail Twitter
Show Answer
Share Facebook gmail Twitter
Show Answer
Share Facebook gmail Twitter
10
How many positions a char pointer jumps when we do ++ on it, in c language?
  1. it will jump 1 byte.
  2. it will jump 2 bytes.
  3. it will jump char size bytes in that system.
  4. it jumps 4 bytes.
Show Answer
Share Facebook gmail Twitter
11
Can we type cast a char * to int * in c?
  1. it will give compile time error.
  2. it will crash at run time.
  3. we can convert, but we have to make sure we are accessing valid address after converting, else it may crash or fetch garbage value.
  4. yes, but it always fetches garbage value if we do so.
Show Answer
Share Facebook gmail Twitter
12
what does this declaration say?

void * (*fp) (int *);
  1. it is a function pointer which takes int * as parameter and returns void *.
  2. it is a void pointer, which points to a function that takes int *.
  3. it is meaning less, gives compile time error.
  4. it is a function that takes int * and returns pointer to a void *.
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
18
Which of the below is a correct way to allocate memory for 10 integers in c?
  1. int *p = malloc(10);
  2. int *p = malloc(40);
  3. int *p = calloc(sizeof(int), 10);
  4. int *p = 40;
Show Answer
Share Facebook gmail Twitter
Show Answer
Share Facebook gmail Twitter
Show Answer
Share Facebook gmail Twitter
Read more papers :