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
How do you flush a buffer in c++?
What is an adjust field format flag?
write a c++ program to create class student having datamember name,Roll_no,age,and branch intilcization all the member using constructor print the all the details on the screen.
What is runtime polymorphism in c++?
When do we use copy constructors?
What is the use of structure in c++?
What are its advantages and disadvantages of multiple inheritances (virtual inheritance)?
Write a function to find the nth item from the end of a linked list in a single pass.
Explain the static storage classes in c++.
Is map sorted c++?
give me an example for testing a program showing the test path .show how the test is important and complex.
Which of the following is not a valid declaration for main() a) int main() b) int main(int argc, char *argv[]) c) They both work
What is stack unwinding?
What is the purpose of templates in c++?
What is switch case in c++ syntax?