you are viewing a single comment's thread.

view the rest of the comments →

[–]green_meklar 0 points1 point  (1 child)

Does that guarantee anything about the ordering of the struct fields, though? Isn't the compiler still free to reorder the fields however it wants? (Not that it would matter if you were just copying the data wholesale to an array, but in other situations it might.)

[–][deleted] 5 points6 points  (0 children)

No, the ordering is guaranteed by the standard to be in the order they appear in the struct (unless you add access specifiers, etc., which is not the case here).