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 is the difference between while and do while loop?
Explain how overloading takes place in c++?
What is an undefined reference/unresolved external symbol error and how do I fix it?
Which software is used to run c++ program?
Explain the difference between new() and malloc() in c++?
Explain some examples of operator overloading?
What is constructor c++?
what is VOID?
When can I use a forward declaration?
Explain pass by value and pass by reference.
How do I start a c++ project?
What methods can be overridden in java?
What is the most useful programming language?
What are separators in c++?
What are references in c++?