What is size of a object of following class?
class Foo
{
public:
void foo(){}
}
Answers were Sorted based on User's Feedback
Answer / sirama
Size of the Object 1 Byte (ie) 8 bits. Because that is
minimum possible size required to allocate something on
memory.
Say If a Create the Object like Foo obj;
Something needs to loaded on Stack. But, actually it does
not have any internal data memebers. Hence, the minimum
possible is 1 Byte.
Is This Answer Correct ? | 5 Yes | 0 No |
Answer / 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 |
what is the difference between linear list linked representaion and linked representation? what is the purpose of representing the linear list in linked represention ? is it not avoiding rules of linear represention?
Explain the uses of static class data?
What is a 'pure' virtual function and what's its use?
structure that describe a hotel with name, address,rooms and number of rooms
What are the different types of comments allowed in c++?
Write about c++ storage classes?
Name the debugging methods that are used to solve problems?
How to demonstrate the use of a variable?
What is endl c++?
Explain the difference between using macro and inline functions?
Who invented turbo c++?
Is it possible to pass an object of the same class in place of object reference to the copy constructor?