C Objective Interview Questions On Pointers

These C Objective Interview Questions On Pointers post providing basic, intermediate and Hard level examples in C Pointers. The Practice of these examples makes you good in C programming.


Comment on the following pointer declaration? [int *ptr, p;]

  1. ptr is a pointer to an integer, p is not
  2. ptr and p, both are pointers to integer
  3. ptr is a pointer to an integer, p may or may not be
  4. None of the above.

Answer :

Ans : 1, p is not pointer variable

Which of the following are correct syntaxes to send an array as a parameter to function?

  1. func(&array);
  2. func(array);
  3. func(*array);
  4. func(array[size]);

Answer :

Ans : 2, Only base address need to pass

Which of the following sentence is correct?

  1. C-language supports only external pointers
  2. C-language doesn’t support internal pointers
  3. C-language supports both internal and external pointers.
  4. None of the above.

Answer :

Ans : 3, Internal pointers like arrays, string, structures and external pointers like pointers concept

Which one of the following is a structure pointer?

  1. int* ptr ;
  2. char* ptr ;
  3. FILE* ptr ;
  4. double* ptr ;
  5. None of the above.

Answer :

Ans : 3, FILE is a pre-defined structure pointer type.

What is a void pointer?

  1. Generic pointer
  2. Can hold any type of address
  3. Used to hold the address of data when we don’t know what type of data we are holding.
  4. Need to typecast into specific pointer type before use.
  5. All of the above.

Answer :

Ans : 5, All are true statements in case of void*

After increment a character pointer by 1, it will be incremented by

  1. the size of the pointer.
  2. size of data which is pointing to
  3. 4 bytes
  4. pointing to the same location.

Answer :

Ans : 2

What is the size of a pointer on the 16-bit compiler?

  1. 4 bytes
  2. 2 bytes
  3. 1 byte
  4. None of the above.

Answer :

Ans : 2, Size of pointer always depends on a number of memory locations availble on the machine

Pick out the odd statement?

  1. Structure variable size is equal to sum of all the elements size
  2. Pointer to structure variable size is equal to size of sum of all the elements size
  3. Structure variable is the internal pointer variable
  4. Structure variable holds base address of memory block.

Answer :

Ans : 2, Pointer to structure variable size equals to pointer size only

After increment float pointer, that will be incremented by…

  1. 4 bytes
  2. 2 bytes
  3. Increased by size bytes equal to pointer size
  4. None of above.

Answer:

Ans: 1, float* always pointing to float data, so it increases by 4 bytes

What is the size of character pointer on the 16-bit compiler?

  1. 1 byte
  2. 2 bytes
  3. 4 bytes
  4. none of the above.

Answer :

Ans : 2, Any type of pointer size is 2 bytes on 16 bit compiler

Objective Interview Questions On Pointers – Part2

Share this