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

List the advantages of inheritance.

1138


Can java be faster than c++?

1156


Write a single instruction that will store an EVEN random integer between 54 and 212 inclusive in the variable myran. (NOTE only generate EVEN random numbers)

1956


What is the best c++ book for beginners?

1155


What is the difference between interpreters and compilers?

1193


Why do you use the namespace feature?

1092


Differentiate between an inspector and a mutator ?

1228


Is it possible to use a new for the reallocation of pointers ?

1066


Is c the same as c++?

1011


Which bit wise operator is suitable for checking whether a particular bit is on or off?

1035


What is encapsulation in c++ with example?

1007


Describe Trees using C++ with an example.

1158


Write bites in Turbo c++ Header ("Include") Files.

1270


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

1122


What is decltype c++?

1003