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
What is difference between c++ 11 and c++ 14?
What is using namespace std in cpp?
What is the real purpose of class – to export data?
what is oops and list its features in c++?
What are the benefits of oop in c++?
What is data types c++?
What is the use of bit fields in structure declaration?
the first character in the variable name must be an a) special symbol b) number c) alphabet
How to defines the function in c++?
What is a stack? How it can be implemented?
What is a modifier in c++?
What is lambda in c++?
What is difference between class and structure in c++?
What is a volatile variable in c++?
Is c++ fully object oriented?