3 ms·
Parent comment was edited to include this quote: _6 When a value is stored in an object of structure or union type, including in a member object, the bytes of
by DougBTX 7y ago
Parent comment was edited to include this quote:
_6 When a value is stored in an object of structure or union type, including in a member object, the bytes of the object representation that correspond to any padding bytes take unspecified values. 51)_
So sure, a memcpy after a memset aught to preserve all the bytes, but if they are updated through a struct which contains padding then the values in the padding bytes will be left unspecified.