If your structure is meant to be used to map in-memory file data you should enforce finer control over the alignment/padding of the structure with #pragma pack where available.
If not available, you should approach the problem in a different way period.
If your byte array was 3 bytes instead of 4 bytes in length, subchunk1Size would still be aligned to 4 bytes, with an extra byte added before it for padding.
Padding does not occur just at the end of structures, but also between members inside the structure, so if you can’t strictly control how it is padded, don’t even try to use that approach.
So no, don’t hard-code 10 anywhere. You should use sizeof(), and if that is not reliable then don’t use this method at all.
L. Spiro