On Monday 07 April 2003 09:34, Steven T. Hatton wrote:
Jerry seems to know what he's talking about.
I don't remember questioning that. I know he knows far more than I about c++
The question remains. How big is an object? What does sizeof really mean?
An object is the size of its members. Plus all objects of a class share the methods of that class. Plus possible padding bytes (don't know about that one, but C sometimes does that for structs and unions, to align the data on word boundaries. I guess c++ does the same, but I don't know). sizeof returns the size of the parameter. I think sizeof for an object returns the dynamic size of that instance. i.e. not counting the methods it shares with other objects of that class.
Also, what's the lifetime of a member variable of derived type when created as a side effect of implicit (automatic?) instantiation in a function call variable declaration?
If I understand the question, I would say from the time the function is called to the time the function returns.