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 |
Difference between static global and global?
16 Answers Microsoft, Symphony, Wipro,
Generally variables are stored in heap memory. When he variables are created in stack?
What are the extraction and insertion operators in c++?
Is java based off c++?
Write a corrected statement in c++ so that the statement will work properly. x =+ 7;
Write a program using shift_half( ) function to shift the elements of first half array to second half and vice versa.
What is the purpose of decltype?
What is abstraction with real time example?
What is vectorial capacity?
catch(exception &e) { . . . } Referring to the sample code above, which one of the following lines of code produces a written description of the type of exception that "e" refers to? a) cout << e.type(); b) cout << e.name(); c) cout << typeid(e).name(); d) cout << e.what(); e) cout << e;
Explain the difference between static and dynamic binding of functions?
Is c++ a programming language?