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 size of this class
class size
{
public:
char data1;
double d;
int data2;
char data3;
double data4;
short data5;
};

please explain the padding for these double variables.

Answer Posted / kanthi

I have a small doubt.. isnt it based upon the underlying
platform on which this piece of code is run?
as far as my c++ knowledge goes, the size of each datatype
varies for each platform unlike java. this is the reason
why java ensures portability of code, while c++ doesnt.
please tell me if i am wrong...

Is This Answer Correct ?    4 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Is turbo c++ free?

1015


How can a struct in c++ differs from a struct in c?

980


How do you remove an element from a set in c++?

1027


What is fflush c++?

947


Why was c++ made?

1038


State two differences between C and C++.

1085


What is extern c++?

939


What is general format for a prototype?

971


What is prototype for that c string function?

1070


What is the use of endl in c++?

972


What is virtual base class?

1000


How do you establish an is-a relationship?

1074


What is endianness?

1035


Why was c++ created?

974


What will strcmp("Astring", "Astring"); return a) A positive value b) A negative value c) Zero

1051