C Objective Interview Questions on Structures and Unions

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


Which of the following Statement about Union is false?

  1. Members share same memory area
  2. Compiler will keep track of what type of information is currently stored
  3. Only one member can be assigned a value at a time
  4. Union size equals to the size of its member needing the maximum storage.

Answer :

Ans : 2

For accessing a structure element using a pointer, you must use?

  1. Address operator (&)
  2. Dot operator(.)
  3. Pointer operator(*)
  4. Arrow operator(->)

Answer :

Ans : 4

Which of the following is themselves a collection of different data types?

  1. String
  2. Structure
  3. Array
  4. All of the mentioned.

Answer :

Ans : 2, Only structure can hold dis-similar data type elements

Difference between structure, union, and enumeration?

  1. Used to define new values
  2. Used to define new data types
  3. Used to define new pointers
  4. Used to define new structures.

Answer :

Ans : 2, All are comes under user defined data types

Doesn’t function allow following return type?

  1. char *
  2. struct
  3. void
  4. None of the above.

Answer :

Ans : 4, All are valid return types

If code contains instruction “s.t.b = 10” indicates…

  1. Syntax Error
  2. structure
  3. nested structure
  4. variable name.

Answer :

Ans : 3, We can access elements of nested structures as mentioned above

A -> B is syntactically correct if?

  1. a and b are the structures
  2. a is a structure and b is a pointer to a structure
  3. a is a pointer to structure and b is a structure
  4. a is a pointer t the structure in which b is a field.

Answer :

Ans : 4, When a pointer pointing to structure, we access members using -> operator

Which operator is used to connect structure name to its member name?

  1. dot operator(.)
  2. logical operator(&&)
  3. pointer operator(&)
  4. Arrow operator(->)

Answer :

Ans : 1, Which is also called accessor in Structures

C Technical Interview Questions On Pointers – Part1

Share this