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 can I disable the "echo" feature?
How can you tell what shell you are running on unix system?
How does java differ from c and c++?
What are the advantages of using a pointer?
Why isn't sizeof for a struct equal to the sum of sizeof of each member?
What is virtual table?
What is the difference between an external iterator and an internal iterator? Describe an advantage of the external iterator.
What is the arrow operator in c++?
what is a reference variable in C++?
What are proxy objects in c++?
What does std mean in c++?
Can the creation of operator** is allowed to perform the to-the-power-of operations?
Write a code/algo to find the frequency of each element in an array?
give me an example for testing a program showing the test path .show how the test is important and complex.
What is #include ctype h in c++?