Explain about the unions, C/C++ Programming

Assignment Help:

Explain what are Unions?

The Unions like as structures, contain members whose individual data types may perhaps differ from one another. Though the members that create a union all share the same storage area within the computer's memory, whereas every member within a structure is assigned its own unique storage area. Therefore the unions are used to converse memory and they are useful for applications involving multiple members where values require not be assigned to all of the members at anyone time.

Within a union, the bookkeeping need to store members whose data types are different (having different memory requirements) is handled automatically by the compiler. Though the user must keep track of what type of information is stored at any given time. An effort to access the wrong type of information will produce meaningless results. 


Related Discussions:- Explain about the unions

Common concepts of object oriented, Object Oriented Programming Paradigm: ...

Object Oriented Programming Paradigm: For OOP, Paradigm is a standard set.  The OOP will help to develop software in modules, which will be integrated later as a full packag

Write a c program to compute the value of a sine wave, Write a C program to...

Write a C program to compute the value of a sine wave from 0 to 2P with an increment of 0.1 radians.   #include stdio.h #include math.h #define pi 3.1415927 void main() {   c

Recursive procedure to computes the number of digits, (a) Write a recursive...

(a) Write a recursive procedure (digits n) that computes the number of digits in the integer n using a linear recursive process. For example, (digits 42) should return 2 and (digit

Define the increment and decrement operators in c language, Define the Incr...

Define the Increment and Decrement Operators in c language? C offers two special operators -and ++ called decrement and increment operators respectively and these are unary ope

How does a structure differ from an array, Question : (a) What is a str...

Question : (a) What is a structure? Provide a simple example of your own to illustrate this feature. (b) How does a structure differ from an array? (c) Describe a structu

AREAS, Write a program to find the area under the curve y = f(x) between x ...

Write a program to find the area under the curve y = f(x) between x = a and x = b, integrate y = f(x) between the limits of a and b. The area under a curve between two points can b

C program for string address, C Program for STRING ADDRESS #include std...

C Program for STRING ADDRESS #include stdio.h> #include conio.h> #include string.h> void main() {           char *name;           int length;           cha

Friendly function and rules of friend function, F r i e n dly Function...

F r i e n dly Function: A class can have public members and private members.   The public member can be used through the class using dot operator.   Where as private me

Big-m method, big-m method operation reseach in progrmme c++..

big-m method operation reseach in progrmme c++..

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