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 / abhishek
absolutely correct navvy agreed !!
just a minor change
short : 2 bytes + 2 byte padding
| Is This Answer Correct ? | 4 Yes | 1 No |
Post New Answer View All Answers
What does getch() do according to the ANSI C++ standard a) Reads in a character b) Checks the keyboard buffer c) Nothing in particular (Its not defined there)
Explain data encapsulation?
Why can’t you call invariants() as the first line of your constructor?
What are the different types of comments allowed in c++?
What are keywords in c++?
What is the header file for setw?
Reads in the size of a square from the screen; 2. Prints a hollow square of that size out of “-“, “|” and blanks on screen; 3. Prints the same hollow square onto a text file. Your program should work for squares of all side sizes between 1 and 20. --- │ │ │ │ │ │ ---
What is a container class? What are the types of container classes in c++?
How many ways can a variable be initialized into in C++?
What is null and void pointer?
What is c++ hash?
Can there be at least some solution to determine the number of arguments passed to a variable argument list function?
How the memory management in vectors are being done. What happens when the heap memory is full, and how do you handle it ?
What is auto used for in c++?
What is the rule of three?