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 2 ways of exporting a function from a dll?

1275


What is the array and initializing arrays in c++?

1076


What apps are written in c++?

1141


What are the different types of polymorphism in c++?

1195


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

1120


Is dev c++ a good compiler?

1015


What can I use instead of namespace std?

1202


What is the best book for c++ beginners?

1097


Is c++ built on c?

1081


Difference between pass by value and pass by reference?

1216


What is null c++?

1182


What is a loop? What are different types of loops in c++?

1177


What is a hashmap c++?

1158


What is jump statement in C++?

1211


Are c and c++ similar?

1113