Monday, 8 April 2019

CP : Union in C


Union in C

Unions are conceptually similar to structures. The syntax to declare/define a union is also similar to that of a structure. 

The only differences are in terms of storage. In structure each member has its own storage location, whereas all members of union uses a single shared memory location which is equal to the size of its largest data member.



This implies that although a union may contain many members of different types, it cannot handle all the members at the same time. A union is declared using the union keyword.

Structure vs. Union






No comments:

Post a Comment

LAB 7 Arduino with Seven Segment Display || Arduino Tutorial || Code and Circuit Diagram || Project

  LAB 7 Arduino with Seven Segment Display || Arduino Tutorial || Code and Circuit Diagram || Project Dear All We will learn how to Connec...