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

Just as an extension to my point in the previous post...
http://www.cplusplus.com/doc/tutorial/variables.html

the section fundamental datatypes in the above article
substantiates my point...

Is This Answer Correct ?    2 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the use of setfill in c++?

581


What is the precedence when there is a global variable and a local variable in the program with the same name?

631


How do you clear a buffer in c++?

535


What do you mean by public protected and private in c++?

597


If a header file is included twice by mistake in the program, will it give any error?

550






What is a lambda function c++?

549


What do you understand by pure virtual function? Write about its use?

577


Why should we use null or zero in a program?

596


the first character in the variable name must be an a) special symbol b) number c) alphabet

599


What is microsoft c++ redistributable?

608


write a corrected statement in c++ so that the statement will work properly. x = y = z + 3a;

1453


What is difference between n and endl in c++?

582


In inline " expression passed as argument are evalauated once " while in macro "in some cases expression passed as argument are evaluated more than once " --> i am not getting it plz help to make me understand....

1943


How long it will take to learn c++?

610


What is a c++ class?

610