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 / abhishek
absolutely correct navvy agreed !!
just a minor change
short : 2 bytes + 2 byte padding
Is This Answer Correct ? | 4 Yes | 1 No |
Post New Answer View All Answers
Is c++ vector dynamic?
Why do we use structure in c++?
What is a hashmap c++?
Do you know what are the new features that iso/ansi c++ has added to original c++ specifications?
Is recursion allowed in inline functions?
Which is better c++ or java?
Explain what are mutator methods in c++?
How did c++ get its name?
Why can templates only be implemented in the header file?
What c++ is used for?
How to declare an array of pointers to integer?
What is the use of endl in c++?
What do you mean by volatile and mutable keywords used in c++?
What is the difference between object-oriented programming and procedural programming?
What is runtime polymorphism in c++?