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
Is it possible to provide default values while overloading a binary operator?
What is fixed in c++?
What is friend class in c++ with example?
int age=35; if(age>80) {Console.WriteLine("Boy you are old");} else {Console.WrieLine("That is a good age");}
Am pass the 10000 records to target in target I will take commit interval 15000 when I was stop the work flow what will happened
Define upcasting.
What is a down cast?
If there are two catch statements, one for base and one for derived, which should come first?
Is c++ platform dependent?
Difference between a homogeneous and a heterogeneous container
What are the manipulators in c++?
Explain the concept of friend function in c++?
which of the following is not an secondary constant a) array b) real c) union
Can we specify variable field width in a scanf() format string? If possible how?
What is iomanip c++?