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 difference between c++ 11 and c++ 14?

1023


What is using namespace std in cpp?

1090


What is the real purpose of class – to export data?

1072


what is oops and list its features in c++?

1005


What are the benefits of oop in c++?

1149


What is data types c++?

973


What is the use of bit fields in structure declaration?

943


the first character in the variable name must be an a) special symbol b) number c) alphabet

1051


How to defines the function in c++?

1072


What is a stack? How it can be implemented?

1138


What is a modifier in c++?

1095


What is lambda in c++?

1140


What is difference between class and structure in c++?

1149


What is a volatile variable in c++?

1389


Is c++ fully object oriented?

928