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

Write my own zero-argument manipulator that should work same as hex?

997


What is set in c++?

1066


Write a program in C++ for Fibonacci series

1135


What is a v-table?

1098


Which should be more useful: the protected and public virtuals?

976


What are libraries in c++?

1016


What is the last index number in an array of 100 characters a) 100 b) 99 c) 101

1090


What is the use of 'this' pointer?

1202


What is fflush c++?

950


Explain the uses oof nested class?

1089


What is tellg () in c++?

1234


What do you mean by function pointer?

1040


What size is allocated to the union variable?

1004


What is array give example?

986


Differentiate between declaration and definition.

981