GeekInterview.com
  I am new, Sign me up!
 
GeekInterview.com  >  Interview Questions  >  Concepts  >  Data Structures
Go To First  |  Previous Question  |  Next Question 
 Data Structures  |  Question 14 of 202    Print  
The size of a structure is determines by the Product of sizes of all primitive data types within the structure?
Skill/Topic: Variables and Pointers
A) True
B) False
Explanation: The size of a structure is the sum of the sizes of all the primitive data types within the structure



  
Total Answers and Comments: 4 Last Update: February 06, 2007   
  
 Sponsored Links

 
 Best Rated Answer
Submitted by: viky_tyc
 

Even this will not be true always. Because of the memory alignment, eventually size of a structure would be >= the sum of sizes of individual structure members.



Above answer was rated as good by the following members:
diamondgolf
January 19, 2006 02:07:58   #1  
samiksc Member Since: October 2005   Contribution: 233    

RE: The size of a structure is determines by the Produ...
(B) False: Size of a structure is sum of sizes of all its member variables of primitive data type.
 
Is this answer useful? Yes | NoAnswer is useful 1   Answer is not useful 0Overall Rating: +1    
March 17, 2006 03:12:14   #2  
viky_tyc Member Since: October 2005   Contribution: 2    

RE: The size of a structure is determines by the Produ...

Even this will not be true always. Because of the memory alignment eventually size of a structure would be > the sum of sizes of individual structure members.


 
Is this answer useful? Yes | NoAnswer is useful 1   Answer is not useful 0Overall Rating: +1    
January 01, 2007 12:02:55   #3  
Chantigd        

RE: The size of a structure is determines by the Produ...
There is concept called as Padding which is completely Operating system dependend.ex:struct a{ int a; int b; char c; int d;}Answer : 2 + 2 + 1 + 2 (bytes) 7Bytes (not correct always) can be 8bytes since the allocation is done in word size which is 2bytes [generally -> depends on O/s and processor]
 
Is this answer useful? Yes | No
February 06, 2007 06:31:25   #4  
sivanesh.a Member Since: December 2006   Contribution: 189    

RE: The size of a structure is determines by the Produ...
yes.
 
Is this answer useful? Yes | No


 
Go To Top


 Sponsored Links

 
About Us -  Privacy Policy -  Terms and Conditions -  Contact -  Ask Question -  Propose Category -  Site Updates 

Copyright © 2005 - 2009 GeekInterview.com. All Rights Reserved

Page copy protected against web site content infringement by Copyscape