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 do you mean by function pointer?
What is a syntax in c++?
what does the following statement mean? int (*a)[4]
What is pointer -to-members in C++? Give their syntax?
Why do we use structure in c++?
Will a catch statement catch a derived exception if it is looking for the base class?
What is enum class in c++?
How does list r; differs from list r();?
Explain terminate() function?
Explain the extern storage classes in c++.
How are virtual functions implemented in c++?
Explain how overloading takes place in c++?
Explain one method to process an entire string as one unit?
Does c++ have finally?
Describe about storage allocation and scope of global, extern, static, local and register variables?