why the size of an empty class is 1
Answers were Sorted based on User's Feedback
Answer / hitesh sojitra
When you calculate the size of a empty class that time you can c it takes 1 byte.which is the size of a char which a compiler takes for storing the address of a empty class.
The size of an empty class would depend on what is the range specified for the compiler for char. It takes that much space to store the address of a class.
| Is This Answer Correct ? | 13 Yes | 1 No |
Answer / abhishek
its because an empty class makes an entry to symbol table (code segment)
which requires a symoblic mapping of 1 byte
| Is This Answer Correct ? | 9 Yes | 4 No |
Answer / kamna
it is becuse each oject must have a different address.
| Is This Answer Correct ? | 10 Yes | 5 No |
Answer / surender a
Because the fundamental size is a char [viz 1 byte by
default on any 32 bit or 64 bit machine].
| Is This Answer Correct ? | 5 Yes | 7 No |
Explain public, protected, private in c++?
Write a C++ Program to Generate Random Numbers between 0 and 100
What are the total number of lines written by you in C/C++? What is the most complicated or valuable program written in C/C++?
What is polymorphism & list its types in c++?
How do you print for example the integers 3,2,1,5,4 in a binary tree within the console in format where it looks like an actual binary tree?
What is a manipulative person?
What is vector pair in c++?
What are structures and unions?
What is the use of :: operator in c++?
Can we remove an element in a single linked list without traversing? Lets suppose the link list is like this 1 2 3 4 5 6 We need to remove 4 from this list (without traversing from beginning) and the final link list shud be 1 2 3 5 6 only thing we know is the pointer to element "4". How can we remove "4" and link "3" to "5"?
What do you mean by early binding?
What jobs can you get with a c++ certification?