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
How will you call C functions from C ++ and vice-versa?
What are the differences between the function prototype and the function defi-nition?
declare an array of structure where the members of the structure are integer variable float variable integer array char variable access all elements of the structure using dot operator and this pointer operator
What is double in c++?
Can you be bale to identify between straight- through and cross- over cable wiring? And in what case do you use straight- through and cross-over?
Should a constructor be public or private?
What is private, public and protected inheritance?
Write a program to concatenate two strings.
What is the difference between strcpy() and strncpy()?
What is a tree in c++?
What is operators in c++?
What is the benefit of learning c++?
What do you mean by stack unwinding in c++?
What are references in c++? What is a local reference?
What are pointers used for c++?