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 is better turbo c++ or dev c++?
Array base access faster or pointer base access is faster?
What is difference between class and function?
the maximum length of a character constant can be a) 2 b) 1 c) 8
What is meant by entry controlled loop? What all C++ loops are exit controlled?
How do you define a class in c++?
What new()is different from malloc()?
Write about the retrieval of n number of objects during the process of delete[]p?
How can I disable the "echo" feature?
When are exception objects created?
How we can differentiate between a pre and post increment operators during overloading?
Differentiate between the manipulator and setf( ) function?
What are the types of pointer?
Can non graphic characters be used and processed in C++?
Why do we use pointers in c++?