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


Please Help Members By Posting Answers For Below Questions

If dog is a friend of boy, is boy a friend of dog?

575


What are the unique features of C++.

574


find the two largest values among the 6 numbers using control structures : do-while,for,if else,nestedif- else ,while. one or two of them.

2001


What is implicit pointer in c++?

604


List down the guideline that should be followed while using friend function.

649






Explain about Virtual Function in C++?

613


Can I make ios apps with c++?

562


What is #include sstream?

626


Can static member variables be private?

631


Mention the purpose of istream class?

623


Is map ordered c++?

596


What are namespaces in c++?

600


How can you specify a class in C++?

802


What is the meaning of c++?

546


Differentiate between a pointer and a reference with respect to c++.

697