What is the difference in size of this two clasees?
Class A
{
int a;
char c;
float f;
}
Class B
{
float f;
char c;
int a;
}
Answer Posted / som shekhar
well there will be no difference..define the macro
#pragma pack(1) and then calculate the size of the class....
Actually compiler aligns the boundary to the nearest larger
byte. If you define the aforementioned macro, compiler will
give you the exact size of the class.
Hope that is clear.
Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
Is java a c++?
What is private inheritance?
Will c++ be replaced?
What is the header file for setw?
What is data type in c++?
What is the role of C++ shorthand's?
How a modifier is similar to mutator?
I want explanation for this assignment: how to connect mysql database using c/c++,please explain this detailly?
What is private, public and protected inheritance?
What does new do in c++?
Define upcasting.
Can c++ be faster than c?
How did c++ start?
Can member data be public?
What is c++ runtime?