what is the difference between structure and union?

Answer Posted / sevak.yatrik777

While structure enables us treat a number of different
variables stored at different in memory , a union enables us
to treat the same space in memory as a number of different
variables. That is a Union offers a way for a section of
memory to be treated as a variable of one type on one
occasion and as a different variable of a different type on
another occasion.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can you assign a different address to an array tag?

694


What are the 4 data types?

592


Explain what is the benefit of using #define to declare a constant?

604


What is the explanation for cyclic nature of data types in c?

640


Which is better oop or procedural?

622






What is a struct c#?

597


Write a program to swap two numbers without using the third variable?

591


Explain two-dimensional array.

621


What are the advantages of union?

624


Write a function stroverlap that takes (at least) two strings, and concatenates them, but does not duplicate any overlap. You only need to worry about overlaps between the end of the first string and the beginning of the second string. Examples: batman, manonthemoon = batmanonthemoon batmmamaman, mamamanonthemoon = batmmamamanonthemoon bat, man = batman batman, batman = batman batman, menonthemoon = batmanmenonthemoon

1730


In a switch statement, explain what will happen if a break statement is omitted?

628


What is string length in c?

600


What is c language & why it is used?

574


What is chain pointer in c?

598


What is sizeof int?

629