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 are 2 ways of exporting a function from a dll?
What is the array and initializing arrays in c++?
What apps are written in c++?
What are the different types of polymorphism in c++?
How many types of modularization are there in c++?
Is dev c++ a good compiler?
What can I use instead of namespace std?
What is the best book for c++ beginners?
Is c++ built on c?
Difference between pass by value and pass by reference?
What is null c++?
What is a loop? What are different types of loops in c++?
What is a hashmap c++?
What is jump statement in C++?
Are c and c++ similar?