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
Difference between class and structure.
What do you mean by translation unit?
What is capacity in vector in c++?
What is the use of this pointer in c++?
What is lazy initialization in c++?
Is c++ proprietary?
What are friend functions in C++?
What are the two main components of c++?
Show the application of a dynamic array with the help of an example.
Is it possible to pass an object of the same class in place of object reference to the copy constructor?
What is meant by entry controlled loop?
What does it mean to declare a member function as static?
What is wrapper class in c++?
Which function cannot be overloaded c++?
What is private public protected in c++?