C Language Interview Questions and Answers for Experienced - 4

Question: 16

Is it possible to nest the functions?

Yes. The functions can be nested.

Question: 17

What is a structure?

Structure is a group name in which dissimilar datas are grouped together.

Question: 18

What are structures in C?

Structures types are primarily used to store records. A record is made up of related fields. This makes it easier to organize a group of related data.

Question: 19

What is void pointer in C?

Void pointer is a generic pointer that can be used to point another variable of any data type.

Void pointer can store the address of a variable belonging to any of the data type.

So, void pointer us also called as general purpose pointer.

Question: 20

What is the difference between structure and union?

Union allocates the memory equal to the maximum memory required by the member of the union but structure allocates the memory equal to the total memory required by the members.

In union, one block is used by all the member of the union but in case of structure, each member has their own memory space.

Union is best in the environment where memory is less as it shares the memory allocated. But structure cannot implement in shared memory.

As memory is shared, ambiguity is more in union, but less in structure.

Self referential union cannot be implemented in any data structure, but self referential structure can be implemented.

 

Related Questions