Original Post
Is there a way I can get the size of a structure without having to manually calculate it? I can't use "sizeof" because it compensates for compiler padding.
What I did find was a post that mentioned using #pragma around your structure definition like so:
#pragma pack (push, 1)
struct TEST {
// Data members here
};
#pragma pack (pop)
Then sizeof works.
But is this something I should use or is there a better way of doing it?
[edited by - JohnG on April 17, 2002 6:48:08 PM]
