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 to connect with oracle 9i with server in socket program in c/c++
What is the use of setprecision in c++?
What are separators in c++?
What does h mean in maths?
What is the difference between an external iterator and an internal iterator? Describe an advantage of an external iterator?
Difference between delete and free.
Why c++ is the best language?
What are the advantages of pointers?
Define stacks. Provide an example where they are useful.
What is the use of object in c++?
What is c++ map?
What are c++ templates used for?
which operator is used for performing an exponential operation a) > b) ^ c) none
What is the full name of logo?
What is the use of this pointer in c++?