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 a unnitialised pointer?
find the two largest values among the 6 numbers using control structures : do-while,for,if else,nestedif- else ,while. one or two of them.
Why is it called c++?
Comment on c++ standard exceptions?
What parameter does the constructor to an ofstream object take?
what are Operators and explain with an example?
Write a program in C++ for Fibonacci series
What is array in c++ pdf?
What is scope resolution operator in c++ with example?
How do you print a string on the printer?
How can you create a virtual copy constructor?
What is a tree in c++?
Do you know what are the new features that iso/ansi c++ has added to original c++ specifications?
What is c++ and its features?
How do I download c++?