jaskiewiczm wrote:Hi Robert,
My question is, what is the length of a complete struct? Is it just the length of its parts? __tagBRecord has 2 IntPtrs in it so is __tagBRecord's length 8 bytes? I'm trying to get these offsets right.
Again, thanks for your help,
If you're laying out it explicitly, the easiest way to calculate the length is to add the size of the final field to that field's offset - so in the case of your __tagBRecord, 4+4=8 as you suggested. In this case that's also equal to the sum of the components, and most of the time I think that's probably true, but if there's unused space in the struct somewhere, it might not be.
I think all that's true