|
| Total Answers and Comments: 5 |
Last Update: August 11, 2009 Asked by: pushpakumar |
|
| | |
|
Submitted by: mucdull Because the class has no members (especially no virtual functions) its objects naturally should have 0 bytes. However the objects must be legally creatable because the class is not abstract (having no pure virtual functions) so there must be a way to address the objects. You cannot address something that does not take up any memory. Since the smallest addressable space is 1 byte, the compiler allocates 1 byte for the objects so to make them addressable.
To dwell on the topic, what do you think is the size of objects of this class?
class C { virtual void Go() {} };
Above answer was rated as good by the following members: j_l_larson | Go To Top
|