adspace


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

I have a small doubt.. isnt it based upon the underlying
platform on which this piece of code is run?
as far as my c++ knowledge goes, the size of each datatype
varies for each platform unlike java. this is the reason
why java ensures portability of code, while c++ doesnt.
please tell me if i am wrong...

Is This Answer Correct ?    4 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How c functions prevents rework and therefore saves the programers time as wel as length of the code ?

1172


What is the latest version on c++?

1217


What character terminates all character array strings a) b) . c) END

1403


Can union be self referenced?

1275


daily Routine of father

1489