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
Specify different types of decision control statements?
Describe friend function & its advantages.
What does return 0 do in c++?
What is atoi?
Why is c++ still used?
What is the difference between set and map in c++?
What will strcmp("Astring", "Astring"); return a) A positive value b) A negative value c) Zero
Can you Mention some Application of C/C++?
Is arr and &arr are same expression for an array?
How to get the current position of the file pointer?
Why do we use using namespace std in c++?
What does scope resolution operator do?
What is a class template in c++?
What is the return value of the insertion operator?
What is the advantage of an external iterator.