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

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

MCQ, in a multilist organisation

in a multilist organisation

Setup and source code with nice user interface, Virtual Webcam effects - Se...

Virtual Webcam effects - Setup and Source code with Nice User Interface Project Description: I want a similar webcam effects application which can apply effects to webcam fee

Destructor, Destructor: The purpose of destructor is to free the memory...

Destructor: The purpose of destructor is to free the memory when the compiler memory is reduced or not enough to execute certain program. Sometimes there may several objects op

Program, salotion of programes

salotion of programes

C program for radius of circle, C Program for RADIUS OF CIRCLE   #de...

C Program for RADIUS OF CIRCLE   #define PI 3.14159 main() {           float r,a;           clrscr();           printf("ENTER THE RADIUS OF A CIRCLE: ");

Opp, what is oops

what is oops

However shouldn''t i always use a printon() method instead , Q: however sho...

Q: however shouldn't I always use a printOn() method instead of a friend function? A: No. The usual cause people wish to always use a printOn() method instead of  a friend fu

Recursion, write a cprogram to calculate fraction through recursion

write a cprogram to calculate fraction through recursion

Algorithms, create algorithm for doubly link list using c data structure

create algorithm for doubly link list using c data structure

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