Saturday, 15 March 2014

struct padding array -



struct padding array -

if have struct this:

struct { int a; int b; int values[20]; }

it have kind of padding?

i've searched matter, info i've found padding between different info types.

it have kind of padding?

i think padding implementation-defined. reasonable explanation, however, won't, since members have aligned same number of bytes. this, indeed, true on mac (os 10.7.5) gcc:

(the size of struct 88 bytes: 4 + 4 + 20 * 4, there's no padding.)

arrays struct padding

No comments:

Post a Comment