Hello everyone,
I heard when define a struct, it is important to make the size of the struct memory aligned.
For example,
Code:struct foo { char p; char[3] align; };struct foo is better than struct goo, even if we only use member p.Code:struct goo { char p; };
Allocate 3 bytes to align with memory. But I do not know why make memory aligned is better. Any reasons? (for example, prevent memory from running out?)
thanks in advance,
George