what is the size of an empty class

Answer Posted / som shekhar

1 byte.

Reason being when compiler sees an empty class then then it
assigns a 1 byte memory, since the compiler sees the
declaration of the class so he needs to assign some space in
the memory, and hence assign 1 byte memory to hold the
address of the class.

Is This Answer Correct ?    4 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the difference between a constructor and a destructor?

609


if i have same function with same number of argument but defined in different files. Now i am adding these two files in a third file and calling this function . which will get called and wht decide the precedence?

2749


hi, this is raju,iam studying b.tech 2nd year,iam want know about group1 and group2 details, and we can studying without going to any instutions? please help me.

1537


Templates mean

1585


Give two or more real cenario of virtual function and vertual object

1849






Which language is pure oop?

545


They started with the brief introduction followed by few basic C++ questions on polumorphism, inheritance and then virtual functions. What is polymorphims? How you will access polymorphic functions in C? How virtual function mechanism works?

1403


What is polymorphism in oops?

556


There are two base class B1,B2 and there is one class D which is derived from both classes, Explain the flow of calling constructors and destructors when an object of derived class is instantiated.

1452


What is polymorphism and types?

595


What is use of overloading?

602


What is and I oop mean?

616


what is the drawback of classical methods in oops?

2914


What is abstraction in oops?

578


What are the three main types of variables?

597