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

What is expression parser in c++

2006


What do you understand by zombie objects in c++?

718


What is the advantage of an external iterator.

653


What are compilers in c++?

700


Is c++ low level?

694






Who created c++?

674


What is function overriding in c++?

684


What is static class data?

656


Write about the members that a derived class can add?

655


How one would use switch in a program?

703


Can notepad ++ run c++?

635


What is general format for a prototype?

690


What are arrays c++?

726


Which one is better- macro or function?

734


What is data abstraction? How is it different from data encapsulation?

617