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
Do vectors start at 0 c++?
What is iostream in c++ used for?
What is the word you will use when defining a function in base class to allow this function to be a polimorphic function?
What is the difference between global int and static int declaration?
Define token in c++.
Who calls main function?
What is a terminating character in c++?
Can I learn c++ as my first language?
Explain the difference between overloading and overriding?
What are smart pointers?
Explain virtual class and friend class.
What are virtual constructors/destructors?
what are the iterator and generic algorithms.
What is the maximum value of a unsigned char a) 255 b) 256 c) 128
Arrange Doubly linked list in the ascending order of its integral value and replace integer 5 with 7?