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 do you invoke a base member function from a derived class in which you have not overridden that function?

1071


what is the difference between overloading & overriding? give example.

1101


What are the extraction and insertion operators in c++?

946


Does dev c++ support c++ 11?

963


Why is main function important?

1051


What jobs can you get with a c++ certification?

987


Difference between class and structure.

1105


What does 7/9*9 equal ? a) 1 b) 0.08642 c) 0

909


What is copy constructor? Can we make copy constructor private in c++?

1025


Explain the differences between private, public and protected and give examples.

954


What is double in c++?

996


Explain the difference between c & c++?

1019


Write a program to find the Factorial of a number

1002


Why is swift so fast?

1057


How can you quickly find the number of elements stored in a dynamic array? Why is it difficult to store linked list in an array?

984