Different Between Structures and Unions?

1. The key word union is used instead of structure.

2. Single memory space is allocated for all the members.

3. Only one member is accessed any time.

Advantages of unions:

1. Unions are used to save the memory space.

2. Unions are useful to create the structure with variable fields.

Related

Write a short note on Unions?

Unions are a concept borrowed from structures and therefore follow the same syntax as structures. However, there is major distinction between them in terms of storage. In struc...

Write about Structures in C languages ?

Arrays can be used to represent a group of data items that belong to the same type, such as int or float. Array is not sufficient for representing a collection of data i...

Write about Random Access Files ( or ) Direct Access Files?

These are occasions, however, when we are interested in accessing only a particular part of a file. This can be achieved with the help of the functions fseek, ftell & rew...

Post a Comment

emo-but-icon
:noprob:
:smile:
:shy:
:trope:
:sneered:
:happy:
:escort:
:rapt:
:love:
:heart:
:angry:
:hate:
:sad:
:sigh:
:disappointed:
:cry:
:fear:
:surprise:
:unbelieve:
:shit:
:like:
:dislike:
:clap:
:cuff:
:fist:
:ok:
:file:
:link:
:place:
:contact:

item