problem with sizeof() function

Hello guys. i have a weird problem whenever i try to create a random access file using this function:

Subclass base

sizeof(Subclass));

the problem i get is that i the sizeof function returns the size of the parent class instead of the class that i enter into the function. I think that its bc it calls the constructor for the parent class first and so it returns the size of that instead of the size of "Subclass". is there any way around this problem.
plz guys i really need help with this one
Could you provide some sample code? I don't think that's supposed to happen...

Oh, and technically sizeof isn't a function, it's an operator. Just so you know.
Last edited on
Topic archived. No new replies allowed.