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 / nomesh
double will occupies 8 bytes. so here two double data type
variables create then this class size is 21
char 1 b
double 8 b
int 2 b
char 1 b
double 2 b
short 1 b
| Is This Answer Correct ? | 2 Yes | 5 No |
Post New Answer View All Answers
How is objective c different from c++?
Which command properly allocates memory a) char *a=new char[20]; b) char a=new char[20]; c) char a=new char(20.0);
Is map thread safe c++?
Explain the difference between abstract class and interface in c++?
What is the difference between set and map in c++?
You want to link a c++ program to c functions. How would you do it?
Difference between a homogeneous and a heterogeneous container
What are abstract data types in c++?
Why is it necessary to use a reference in the argument to the copy constructor?
Why c++ is created?
Is c++ a dying language?
What is the role of copy constructor in copying of thrown objects?
Are there any special rules about inlining?
What is the difference between interpreters and compilers?
What are multiple inheritances (virtual inheritance)?