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 / abhishek
absolutely correct navvy agreed !!
just a minor change
short : 2 bytes + 2 byte padding
| Is This Answer Correct ? | 4 Yes | 1 No |
Post New Answer View All Answers
What are c++ storage classes?
How many characters are recognized by ANSI C++?
which one is equivalent to multiplying by 2:Left shifting a number by 1 or Left shifting an unsigned int or char by 1?
Can recursive program be written in C++?
What is searching? Explain linear and binary search.
What is else syntax in c++?
What does scope resolution operator do?
What is c++ in english?
What is a c++ object?
What can c++ be used for?
How come you find out if a linked-list is a cycle or not?
Can constructor be static in c++?
Write a program that takes a 5 digit number and calculates 2 power that number and prints it.
Where are setjmp and longjmp used in c++?
Why is c++ difficult?