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 / nomesh
double will occupies 8 bytes. so here two double data type
variables create then this class size is 21
char 1 b
double 8 b
int 2 b
char 1 b
double 2 b
short 1 b
| Is This Answer Correct ? | 2 Yes | 5 No |
Post New Answer View All Answers
List the advantages of inheritance.
Can java be faster than c++?
Write a single instruction that will store an EVEN random integer between 54 and 212 inclusive in the variable myran. (NOTE only generate EVEN random numbers)
What is the best c++ book for beginners?
What is the difference between interpreters and compilers?
Why do you use the namespace feature?
Differentiate between an inspector and a mutator ?
Is it possible to use a new for the reallocation of pointers ?
Is c the same as c++?
Which bit wise operator is suitable for checking whether a particular bit is on or off?
What is encapsulation in c++ with example?
Describe Trees using C++ with an example.
Write bites in Turbo c++ Header ("Include") Files.
What is the difference between an external iterator and an internal iterator? Describe an advantage of an external iterator?
What is decltype c++?