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 is a modifier in c++?
Write a recursive program to calculate factorial in c++.
How compile and run c++ program in turbo c++?
Will this c++ program execute or not?
Explain the advantages of using friend classes.
What is scope operator in c++?
What is the use of class in c++?
Define whitespace in C++.
Is c++ high level programming language?
What does flush do?
What is stream and its types in c++?
total amount of milk produced each morning and then calculates and outputs the number of cartons needed for this milk , the cost of producing the milk and the profit from producing this milk.
What are multiple inheritances (virtual inheritance)? What are its advantages and disadvantages?
Write a program to show polymorphism in C++?
What is the array and initializing arrays in c++?