answersLogoWhite

0

How does union works in c?

User Avatar

Shashidharsharma

Lvl 1
14y ago
Updated: 8/16/2019

Union is a heterogeneous (having different data types) data structure. In union,all members share same memory for their storage..keyword used is union.it is similar to structures only keyword is different.

size assigned to union is the size of the largest data type in the union.

for example consider a union abc-

union abc{

int int1;

char ch1;

double db;

}un;

the size of un will be 8 byte, since it is the size of the largest data type in the union.

we can assign a value to only one component of the union at a time, it will overwrite the last value.

User Avatar

Wiki User

14y ago

What else can I help you with?

Related Questions

How do you solve A intersecting B union C?

The answer depends on whether you mean A intersecting (B union C) or (A intersecting B) union C.


Is it true that if a union c equals b union c then a equals b?

No- this is not true in general. Counterexample: Let a = {1,2}, b = {1} and c ={2}. a union c = [1,2} and b union c = {1,2} but a does not equal b. The statement be made true by putting additional restrictions on the sets.


What is the complement of the union B and C?

not (b or c) = (not b) and (not c)


When was Works of C. Rajagopalachari born?

Works of C. Rajagopalachari was born on 1878-12-10.


Prove if a union c equals b union c and a intersect c equals b intersect c then a equals b?

suppose x is in B. there are two cases you have to consider. 1. x is in A. 2. x is not in A Case 1: x is in A. x is also in B. then x is in A intersection B. Since A intersection B = A intersection C, then this means x is in A intersection C. this implies that x is in C. Case 2: x is not in A. then x is in B. We know that x is in A union B. Since A union B = A union C, this means that x is in A or x is in C. since x is not in A, it follows that x is in C. We have shown that B is a subset of C. To show that C is subset of B, we do the same as above.


What is the venn diagram of a union b union c?

Venn diagram is represented with the help of circles. Union of a, b and c is shown by the three fully shaded somewhat overlapped circles. Result will be the elements that is in all three sets(a,b,c).


Structure and union in c?

Both usable.


Example for union in c?

union intlong { int i; long l; long long ll; };


Is C and S Wholesale Grocers Inc Union?

no


How union works in c?

Union is a heterogeneous (having different data types) data structure. In union,all members share same memory for their storage..keyword used is union.it is similar to structures only keyword is different. size assigned to union is the size of the largest data type in the union. for example consider a union abc- union abc{ int int1; char ch1; double db; }un; the size of un will be 8 byte, since it is the size of the largest data type in the union. we can assign a value to only one component of the union at a time, it will overwrite the last value.


Define a scab in labor union terms?

A person who crosses a picket line, or works where the legal union has called a strike.


With the aid of a diagram illustrate how the c plus plus compiler works?

With the aid of a diagram,illustrate how the c plus plus compiler works?