Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

Why are pointers not used in c++?

1188


Explain the difference between abstract class and interface in c++?

1033


Why we use #include conio h in c++?

1097


Can notepad ++ run c++?

1145


What is the main purpose of overloading operators?

1203


What are punctuators in c++?

1209


What is the purpose of extern storage specifier?

1252


Why do you use the namespace feature?

1131


Is c# written in c++?

1029


What does the nocreate and noreplace flag ensure when they are used for opening a file?

1172


What is a c++ vector?

1117


Which operator cannot overload?

1095


what is the difference between overloading & overriding? give example.

1261


What are keywords in c++?

1152


Can union be self referenced?

1215