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
Which is not a valid keyword a) public b) protected c) guarded
Which function should be used to free the memory allocated by calloc()?
Explain the difference between overloading and overriding?
Describe private, protected and public – the differences and give examples.
Write a program to show polymorphism in C++?
What is bubble sort c++?
What are inline functions? What is the syntax for defining an inline function?
the maximum length of a character constant can be a) 2 b) 1 c) 8
Can user-defined object be declared as static data member of another class?
Explain polymorphism?
Which is the best c++ compiler?
Is c++ the hardest language?
What is #include ctype h in c++?
Can constructor be private in c++?
Explain the term memory alignment?