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
Const char *p , char const *p What is the difference between the above two?
What is the difference between prefix and postfix versions of operator++()?
Explain the difference between static and dynamic binding of functions?
What is iomanip c++?
Why we use #include iostream in c++?
What is the use of string in c++?
Can you please explain the difference between static and dynamic binding of functions?
What is functions syntax in c++?
How const int *ourpointer differs from int const *ourpointer?
Differentiate between a copy constructor and an overloaded assignment operator.
Is linux written in c or c++?
What does override mean in c++?
What is the difference between C and CPP?
Write a program that takes a 5 digit number and calculates 2 power that number and prints it.
What is the full form of ios?