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

How can I disable the "echo" feature?

1163


How can you tell what shell you are running on unix system?

1111


How does java differ from c and c++?

995


What are the advantages of using a pointer?

1076


Why isn't sizeof for a struct equal to the sum of sizeof of each member?

995


What is virtual table?

1113


What is the difference between an external iterator and an internal iterator? Describe an advantage of the external iterator.

1056


What is the arrow operator in c++?

1016


what is a reference variable in C++?

1237


What are proxy objects in c++?

1179


What does std mean in c++?

1120


Can the creation of operator** is allowed to perform the to-the-power-of operations?

993


Write a code/algo to find the frequency of each element in an array?

1113


give me an example for testing a program showing the test path .show how the test is important and complex.

2928


What is #include ctype h in c++?

1165