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
What is general format for a prototype?
Difference between overloading vs. Overriding
What do you mean by late binding?
Define the operators that can be used with a pointer.
Why c++ is called oop?
On throwing an exception by the animal constructor in p = new animalq, can memory leak occur?
How much maximum can you allocate in a single call to malloc()?
When to use “const” reference arguments in a function?
What is bubble sort c++?
What is nested class in c++?
What are pointer-to-members? Explain.
What is a singleton class c++?
What is an object in c++?
Is c++ double?
What is implicit pointer in c++?