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

double will occupies 8 bytes. so here two double data type
variables create then this class size is 21

char 1 b
double 8 b
int 2 b
char 1 b
double 2 b
short 1 b

Is This Answer Correct ?    2 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Specify different types of decision control statements?

917


Describe friend function & its advantages.

1173


What does return 0 do in c++?

1080


What is atoi?

1022


Why is c++ still used?

1135


What is the difference between set and map in c++?

1178


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

1152


Can you Mention some Application of C/C++?

1126


Is arr and &arr are same expression for an array?

1099


How to get the current position of the file pointer?

1101


Why do we use using namespace std in c++?

1125


What does scope resolution operator do?

1163


What is a class template in c++?

1097


What is the return value of the insertion operator?

1175


What is the advantage of an external iterator.

1112