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
How do you invoke a base member function from a derived class in which you have not overridden that function?
what is the difference between overloading & overriding? give example.
What are the extraction and insertion operators in c++?
Does dev c++ support c++ 11?
Why is main function important?
What jobs can you get with a c++ certification?
Difference between class and structure.
What does 7/9*9 equal ? a) 1 b) 0.08642 c) 0
What is copy constructor? Can we make copy constructor private in c++?
Explain the differences between private, public and protected and give examples.
What is double in c++?
Explain the difference between c & c++?
Write a program to find the Factorial of a number
Why is swift so fast?
How can you quickly find the number of elements stored in a dynamic array? Why is it difficult to store linked list in an array?