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
Explain "const" reference arguments in function?
Is c++ pass by reference or value?
What are member functions used in c++?
what are the types of Member Functions?
what are the decision making statements in C++? Explain if statement with an example?
Is c++ low level?
What is c++ prototype?
What are pointers used for c++?
Will a catch statement catch a derived exception if it is looking for the base class?
What is this weird colon-member (" : ") syntax in the constructor?
What is the main use of c++?
Show the declaration for a static function pointer.
what is C++ exceptional handling?
Is c++ fully object oriented?
Why are pointers not used in c++?