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
What is the difference between a declaration and a definition?
What does new return if there is insufficient memory to make your new object?
Why is main an int?
What is c++ similar to?
Explain the operation of overloading of an assignment operator.
What is private, public and protected inheritance?
What is java and c++?
How do you import payscale data from non SAP to SAP?is it through LSMW or any other way is there?
How important is c++?
Why are arrays usually processed with for loop?
Why is null pointer used?
What is the full form of dos?
How do pointers work?
What does n mean in c++?
Explain about Garbage Collector?