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 equivalent of Pascal's Real a) unsigned int b) float c) char
Write a program using GUI concept for the scheduling algorithms in Operating system like SJF,FCFS etc..
How do you write a function that can reverse a linked-list?
If there are two catch statements, one for base and one for derived, which should come first?
Write a struct time where integer m, h, s are its members?
Is string an object in c++?
What is the best ide for c++?
what is the difference between overloading & overriding? give example.
What is a map in c++?
Write a program which uses Command Line Arguments
Inline parameters : What does the compiler do with the parameters of inline function, that can be evaluated in runtime ?
What is singleton pattern in c++?
Why do we use vector in c++?
What is the iunknown interface?
Is there finally in c++?