ALLInterview.com :: Home Page KalAajKal.com
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
Do you have a collection of Interview Questions and interested to share with us!!
Please send that collection to along with your userid / name. ThanQ
Google
 
Categories >> Code-Snippets >> Programming-Code >> C-Code
 
 
 
Question
What is the main difference between STRUCTURE and UNION?
 Question Submitted By :: Mariaalex007
I also faced this Question!!     Rank Answer Posted By  
 
Answer
1) Structure: The size in bytes is the sum total of size of 
all the elements in the structure, plus padding bytes.
2) Size of in bytes of the union is size of the largest 
variable element in the union. 

i.e In case of Union, the elements making up the 
union 'overlap' in memory OR they are accessed as diffrent 
name/type at diffrent places in the program.

Whereas in case of Struct, each of the elements have a 
distinct identity.
 
0
Ravi
 
View All Answers
 
 
 
 
 
   
Copyright Policy  |  Terms of Service  |  Help  |  Site Map 1  |  Articles  |  Site Map  |   Site Map  |  Contact Us interview questions urls   External Links 
   
Copyright © 2007  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  Forum9.com   ::  KalAajKal.com