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.

 


Why is pointer operator called indirection operator?

  1. It can access info without using memory address
  2. It can access info without using memory variable name
  3. All of the above
  4. None of the above.

Answer :

Ans : 2

Which of the following job is done by the instruction ++*p for an integer pointer p?

  1. increment the value contained at address p
  2. increment the address contained in p
  3. Both A and B
  4. Neither A nor B.

Answer :

Ans : 1, *p represents a value which is inside address, hence the value will be increased using modify oeprator

Which of the following is the correct way to declare a pointer to an array of 3 integer elements?

  1. int *p[3] ;
  2. int *(p+3);
  3. int (*p)[3];
  4. int (*p)(3);

Answer :

Ans : 3

Which of the following is an invalid pointer declaration?

  1. int *p[10];
  2. int (*p) [10];
  3. int (*p)( );
  4. int[10] *p ;

Answer :

Ans : 4

Which of the following not a call by reference?

  1. Passing array as a parameter
  2. Passing structure as a parameter
  3. Passing float as a parameter
  4. Passing address of integer as a parameter.

Answer :

Ans : 3 , float is a value but not the address

How can we return a string function in C program?

  1. Defining function return type as String
  2. Function returns char* pointer variable
  3. It is not allowed
  4. None of the above.

Answer :

Ans : 2

Describe the following pointer declaration [int* ptr(int , int)]

  1. Pointer to function taking 2 integer arguments and returns integer
  2. Function taking 2 integer arguments and returns integer pointer
  3. Both a and b
  4. None of above.

Answer :

Ans : 2 , ‘ptr’ is the function name in the above declaration

What is the indirection operator in the following operators?

  1. !
  2. &
  3. *
  4. ^

Answer :

Ans : 3, Used to process information of variable indirectly without using its identity

What is the use of a pointer to the pointer?

  1. To write complex pointer programming
  2. To access the data of pointer to pointer
  3. Used in complex data structures
  4. All of the above.

Answer :

Ans : 4

 C Objective Interview Questions On Files – Part1

Share this