fwrite/fread and classes

Started by
2 comments, last by krumms 21 years, 9 months ago
What is actually written to a file when you use fwrite to store a class in a file? For example, is the vtbl pointer stored in there as well? Function addresses? or are only data members stored? Sorry the wording for the question is a bit awkward - and I''m certain it''s an easy enough question Thanks
refrain_from_stupidity( &me );
Advertisement
Pointer to vtable, data members, and any "memory alignment holes." I think that''s it.
Hmm okays thanks ...

I did a quick check with a float an integer and a character in a class with nothing but a constructor, and the only thing that was somewhat strange was the fact that the character was padded with three 0xCC bytes ... *shrugs* anyways, thanks

Tom
refrain_from_stupidity( &me );
It likes to work in multiples of four, so those extra three pad bytes were added to make things neat. And padded.

This topic is closed to new replies.

Advertisement