Answer Posted / orvaishnavi
The size of an empty class is 1.
Reason - An object of a class should have unique address.
In order for the object to get unique address, the compiler
inserts a dummy type of size 1(least positive value) into
the empty class so the sizeof the class is returned as 1.
| Is This Answer Correct ? | 5 Yes | 0 No |
Post New Answer View All Answers
Which compiler does turbo c++ use?
Specify some guidelines that should be followed while overloading operators?
What happens when you make call 'delete this;'?
Why are pointers not used in c++?
Why is main an int?
What is the role of static keyword for a class member variable?
What is wrapper class in c++?
Do vectors start at 0 c++?
Describe public access specifiers?
What is const in c++?
Difference between a homogeneous and a heterogeneous container
What is ios :: in in c++?
When does a 'this' pointer get created?
How will you call C functions from C ++ and vice-versa?
What are the differences between new and malloc?