what is the size of this class
class size
{
public:
char data1;
double d;
int data2;
char data3;
double data4;
short data5;
};
please explain the padding for these double variables.
Answer Posted / nivvy
This size is 32
Char : 1 + 3 bytes padding
Doube : 8 Bytes
int : 4 bytes
char : 1 + 3 bytes padding
double : 8 bytes
short : 4 bytes
so 32 bits
| Is This Answer Correct ? | 6 Yes | 0 No |
Post New Answer View All Answers
What is the best c++ compiler?
What are the types of container classes?
Should the member functions which are made public in the base class be hidden?
Const char *p , char const *p What is the difference between the above two?
Which is the best c++ compiler?
How can we access protected and private members of a class?
Are c and c++ different?
Is dev c++ free?
What is c++ manipulator?
Explain rtti.
which one is equivalent to multiplying by 2:Left shifting a number by 1 or Left shifting an unsigned int or char by 1?
Write a corrected statement in c++ so that the statement will work properly. if (4 < x < 11) y=2*x;
What is iomanip c++?
What is meant by entry controlled loop? What all C++ loops are exit controlled?
What can I use instead of namespace std?