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

Add words in dictionary - c++ program, Add words in Dictionary: void D...

Add words in Dictionary: void Dictionary::add( Object& objectToAdd ) {     if( !objectToAdd.isAssociation() )         ClassLib_error( __ENOTASSOC );     else

I need voting bot, Project Description: Seeking a Voting Bot Script / Pr...

Project Description: Seeking a Voting Bot Script / Program Skills required are ASP, Javascript, C Programming, PHP, Software Architecture

Area, find area uder the curve y=f(x) between x=a and x=b   #incl...

find area uder the curve y=f(x) between x=a and x=b   #include float start_point, /* GLOBAL VARIABLES */ end_point, total_area; in

Compiler design, Compiler Design - Limit In The Method Instructions

Compiler Design - Limit In The Method Instructions

''c'' programme, Write a ''C'' program to accept any 3 digit integer number...

Write a ''C'' program to accept any 3 digit integer number from the keyboard and display the word equivalent representation of the given number.

Plot an objects, write a C code that plots an object on the window and on t...

write a C code that plots an object on the window and on the user''s click of mouse on the window, the object starts rotating continuously until the user presses the mouse again

Recursive function, Write a recursive function recursiveMin that takes an i...

Write a recursive function recursiveMin that takes an integer array, a starting subscript and an ending subscript as arguments, and returns the smallest element in the array. The f

Random searching, write aprogram for random -search to implement if a[i]=x;...

write aprogram for random -search to implement if a[i]=x;then terminate other wise continue the search by picking new randon inex into a

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