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
Is turbo c++ free?
How can a struct in c++ differs from a struct in c?
How do you remove an element from a set in c++?
What is fflush c++?
Why was c++ made?
State two differences between C and C++.
What is extern c++?
What is general format for a prototype?
What is prototype for that c string function?
What is the use of endl in c++?
What is virtual base class?
How do you establish an is-a relationship?
What is endianness?
Why was c++ created?
What will strcmp("Astring", "Astring"); return a) A positive value b) A negative value c) Zero