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;
}

Answers were Sorted based on User's Feedback



What is the difference in size of this two clasees? Class A { int a; char c; float f; } Class..

Answer / truong nguyen

1. No difference in size in this case. There will be
difference in size, however, if the class A and B are
defined below:

Class A
{
int a;
double d;
char c;
}
Class B
{
double d;
char c;
int a;
}

Is This Answer Correct ?    3 Yes 0 No

What is the difference in size of this two clasees? Class A { int a; char c; float f; } Class..

Answer / som shekhar

No difference

Is This Answer Correct ?    3 Yes 2 No

What is the difference in size of this two clasees? Class A { int a; char c; float f; } Class..

Answer / 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

What is the difference in size of this two clasees? Class A { int a; char c; float f; } Class..

Answer / nisha

no difference

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More C++ General Interview Questions

How many types of comments are there in c++?

0 Answers  


What do you understand by zombie objects in c++?

0 Answers  


What are the differences between the function prototype and the function defi-nition?

0 Answers  


Write a program that read 2o numbers in and array and output the second largest number. Can anybody help??

7 Answers  


throw Can constructors exceptions?

1 Answers  


What do you mean by inheritance in c++? Explain its types.

0 Answers  


Can we distribute function templates and class templates in object libraries?

0 Answers  


Why do we use templates?

0 Answers  


Why c++ is called oop?

0 Answers  


What are smart pointers?

3 Answers  


Is atoi safe?

0 Answers  


Explain about vectors in c ++?

0 Answers  


Categories