Answer Posted / amit basak
The size of the class will be 1 byte as mentioned by Rahul...
Here is the below code in Cygwin ...
// This program is to find the size of empty class
#include<iostream>
using namespace std;
class Demo
{
};
int main ()
{
cout <<"Sizeof Demo class is ="<<sizeof(Demo)<<endl;
return(0);
}
And here is the output..
$ ./a.exe
Sizeof Demo class is =1
| Is This Answer Correct ? | 14 Yes | 1 No |
Post New Answer View All Answers
Explain the difference between static and dynamic binding of functions?
Write some differences between an external iterator and an internal iterator?
Why is that unsafe to deal locate the memory using free( ) if it has been allocated using new?
What is a container class?
Can we use this pointer in a class specific, operator-overloading function for new operator?
Does c++ cost money?
What is meaning of in c++?
Would you rather wait for quicksort, linear search, or bubble sort on a 200000 element array? (Or go to lunch...) a) Quicksort b) Linear Search c) Bubble Sort
What is encapsulation in c++?
Explain about Garbage Collector?
Can I learn c++ without knowing c?
Does improper inheritance have a potential to wreck a project?
. If employee B is the boss of A and C is the boss of B and D is the boss of C and E is the boss of D. Then write a program using the Database such that if an employee name is Asked to Display it also display his bosses with his name. For eg. If C is displayed it should also display D and E with C?
List the merits and demerits of declaring a nested class in C++?
What is the use of lambda in c++?