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

What is abstraction in c++ with example?

1093


What is c++ try block?

1027


How can an improvement in the quality of software be done by try/catch/throw?

1047


How to tokenize a string in c++?

1044


Is c++ a programming language?

1065


What does ios :: app do in c++?

1019


What is oops in c++?

1050


Is c++ an oop?

1074


What is a linked list in c++?

1041


Which compiler does turbo c++ use?

1061


Is ca high or low level language?

1070


Explain deep copy and a shallow copy?

1042


What are literals in C++?

1012


What would happen on forgetting [], while deallocating an array through new?

1072


Is there structure in c++?

1013