Unions

Unions are similar to structures but only one member within the union can be used at a time, due to it having a shared memory for all members.

 

union Publication {

char name[20] ;
float price ;
int pages ;
};

 

Unions are used when justĀ one condition will be applied and only one variable is required.

 

Compile & Run:

The best OS is fun, free and better! It costs less than $0.01 and has about 1200 developers on each release!

Leave a Reply