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

Can we change the basic meaning of an operator in c++?

858


What is buffering in c++?

805


Can you pass a vector to a function?

729


How do you declare A pointer to a function which receives nothing and returns nothing

941


What is the use of this pointer in c++?

783


Explain what are accessor methods?

854


What is virtual destructor? What is its use?

777


Why c++ is so important?

816


What is purpose of new operator?

805


how to access grid view row?

1991


What are static and dynamic type checking?

804


How should a contructor handle a failure?

901


What is near, far and huge pointers? How many bytes are occupied by them?

875


Write a Program for read a line from file from location N1 to N2 using command line arguments. Eg:exe 10 20 a.c

1034


How do you clear a buffer in c++?

723