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

What are exceptions c++?

1046


Is map thread safe c++?

1083


What are advantages of using friend classes?

1078


Why #include is used?

1073


what are the iterator and generic algorithms.

1942


Does there exist any way to make the command line arguments available to other functions without passing them as arguments to the function?

1251


What are maps in c++?

967


Explain the use of this pointer?

1158


What is cin clear () in c++?

1231


When the constructor of a base class calls a virtual function, why doesn't the override function of the derived class gets called?

1103


Is c++ a pure oop language?

1085


What is a container class? What are the types of container classes in c++?

1270


Define linked lists with the help of an example.

1030


How can you say that a template is better than a base class?

1073


Why do we use classes in programming?

1042