What is size of a object of following class?
class Foo
{
public:
void foo(){}
}
Answer Posted / jitendra varshney
The size of the object here will be 1. Because by default,
if no variable is declared in the class the size of object is 1.
this is due to fact that when two or more object of the
class is defined then they would have the different
addresses. But if size would have been zero then it might be
possible that two or more object can have the same address.
| Is This Answer Correct ? | 1 Yes | 1 No |
Post New Answer View All Answers
What are the various compound assignment operators in c++?
What do you mean by vtable and vptr in c++?
Arrange Doubly linked list in the ascending order of its integral value and replace integer 5 with 7?
Explain the concept of copy constructor?
What is abstract keyword in c++?
Which c++ compiler is best?
Write about a nested class and mention its use?
Write a function to perform the substraction of two numbers. Eg: char N1="123", N2="478", N3=-355(N1-N2).
How would you use qsort() function to sort an array of structures?
what is the difference between linear list linked representaion and linked representation? what is the purpose of representing the linear list in linked represention ? is it not avoiding rules of linear represention?
Is java the same as c++?
What are vtable and vptr?
What do the header files usually contains?
What is the difference between object-oriented programming and procedural programming?
What is the disadvantage of using a macro?