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

This size is 32

Char : 1 + 3 bytes padding
Doube : 8 Bytes
int : 4 bytes
char : 1 + 3 bytes padding
double : 8 bytes
short : 4 bytes

so 32 bits

Is This Answer Correct ?    6 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can java be faster than c++?

1203


Do vectors start at 0?

1044


Is it possible to pass an object of the same class in place of object reference to the copy constructor?

1101


What is a NULL Macro? What is the difference between a NULL Pointer and a NULL Macro?

1159


Eplain extern keyword?

1082


What is capacity in vector in c++?

1056


We all know that a const variable needs to be initialized at the time of declaration. Then how come the program given below runs properly even when we have not initialized p?

1137


How do c++ struct differs from the c++ class?

1262


What is the use of setprecision in c++?

1052


What are 2 ways of exporting a function from a dll?

1274


How to allocate memory dynamically for a reference?

1094


Differentiate between a constructor and a destructor in c++.

1052


How is c++ different from java?

1098


What are the four main data types?

1135


Why is the function main() special?

1144