Write a program that illustrate union declaration, C/C++ Programming

Assignment Help:

Write a Program that illustrate union declaration?

A C program encloses the following union declaration:

union id
{
char color[12];
int size;
} shirt, blouse;

At this time we have two union variables, blouse and shirt, of type id. Each variable is able to represent either a 12-character string (color) of an integer quantity (size) at anyone time.

The 12-character string will require additional storage area within the computer's memory than the integer quantity. Consequently a block of memory large sufficient for the 12-character string will be allocated to every union variable. Thus compiler will automatically distinguish between the 12-character array and the integer quantity within the given block of memory as required.


Related Discussions:- Write a program that illustrate union declaration

Coding, dispaly the last ant on rod

dispaly the last ant on rod

Electrical eng, calculate the total resisitance of a series circuit?

calculate the total resisitance of a series circuit?

Recursion, write a program to solve e^x

write a program to solve e^x

Should i call a destructor explicitly on a local variable?, Should I call a...

Should I call a destructor explicitly on a local variable?

Recursion, Given a string, print all possible palindromic partitions using ...

Given a string, print all possible palindromic partitions using recursion

Decodethecode, decode smugglers are very smart in day by day

decode smugglers are very smart in day by day

If statement, who to write max if statements in a program

who to write max if statements in a program

Explain about the variables in c language, Explain about the Variables in c...

Explain about the Variables in c language? The Variable is an identifier that is used to represent some specified kind of information within a designated portion of the program

Array, If an array holds integer, each of which is four bytes long, how man...

If an array holds integer, each of which is four bytes long, how many bytes from the base location of the array is the location of the fifth element?

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd