KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
If I have a union, C standard guarantees that the union itself will be aligned to the size of the largest element. union U { long l; int i; short s; char c[2]; } u; But what does it say about alignment of individual union elements inside the union? Is the following expression guaranteed to be true? (&u.l == &u.i) && (&u.i == &u.s) && (&u.s == &u.c[0])
Tags (comma-separated)
Save Edits
Cancel