Wednesday, September 1, 2010

How much is size of struct having 1 char & 1 integer?

The size of the stucture depends on the following factors.

1.Depends on the size of the datatype, allocated by compiler
2.Depends on the allignment of the variables in the
structure.

If variables of different datatypes are misalligned, then
badding bytes will be added by the compiler to falitate to
speed up the memory access by the processor.So that the size
of the structure will increase

No comments:

Post a Comment