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
Can we change the basic meaning of an operator in c++?
What is buffering in c++?
Can you pass a vector to a function?
How do you declare A pointer to a function which receives nothing and returns nothing
What is the use of this pointer in c++?
Explain what are accessor methods?
What is virtual destructor? What is its use?
Why c++ is so important?
What is purpose of new operator?
how to access grid view row?
What are static and dynamic type checking?
How should a contructor handle a failure?
What is near, far and huge pointers? How many bytes are occupied by them?
Write a Program for read a line from file from location N1 to N2 using command line arguments. Eg:exe 10 20 a.c
How do you clear a buffer in c++?