Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   C Programming (http://www.velocityreviews.com/forums/f42-c-programming.html)
-   -   struct padding (http://www.velocityreviews.com/forums/t684622-struct-padding.html)

Fred 05-18-2009 08:48 PM

struct padding
 
Given a struct
typedef struct MyStruct {
SomeType var;
/* other members */
} MyStruct;

is it guaranteed that sizeof(MyStruct) includes sufficient
padding such that the next byte AFTER a variable of type
MyStruct will be aligned properly to hold a new variable of
type SomeType ?

I presume this must be so since otherwise there could be
problems accessing members of a MyStruct array.
--
Fred K ?


All times are GMT. The time now is 08:55 PM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.