What is size of a object of following class?
class Foo
{
public:
void foo(){}
}

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What kind of problems can be solved by a namespace?

693


What is a wchar_t in c++?

692


Is oops and c++ same?

677


What is an overflow error?

716


How many namespaces are there in c++?

642






When should we use container classes instead of arrays?

674


Why do we use constructor?

712


What is meant by iomanip in c++?

713


Mention the ways in which parameterized can be invoked.

622


What is the difference between new() and malloc()?

707


When do we run a shell in the unix system?

673


What do c++ programmers do?

653


What do you mean by ‘void’ return type?

720


What does return 0 do in c++?

688


Is c++ vector a linked list?

645