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
What you know about structures in C++?
What is meant by entry controlled loop? What all C++ loops are exit controlled?
Mention the storage classes in c++.
What doescout<<(0==0) print out a) 0 b) 1 c) Compiler error: Lvalue required
What is the difference between struct and class?
Explain the difference between realloc() and free() in c++?
How many standards of c++ are there?
How to allocate memory dynamically for a reference?
What is c++ virtual inheritance?
Explain the difference between c++ and java.
What does std mean in c++?
Explain how the virtual base class is different from the conventional base classes of the opps.
Explain method of creating object in C++ ?
What do you understand by zombie objects in c++?
How c functions prevents rework and therefore saves the programers time as wel as length of the code ?