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 are the advantages of using pointers in a program?
How would perform Pattern Matching in C++?
In the derived class, which data member of the base class are visible?
Will the following program execute?
Which function cannot be overloaded c++?
How does c++ structure differ from c++ class?
What is a constructor in c++ with example?
Explain virtual class?
Write some differences between an external iterator and an internal iterator? Describe the advantage of an external iterator.
Is c++ double?
Why do you use the namespace feature?
Write a program to add three numbers in C++ utilizing classes.
Are c and c++ similar?
Differentiate between the message and method in c++?
What is fixed in c++?