What is size of a empty class?

Answer Posted / mashal

Size of an empty class is 1 byte. It is non zero to ensure that the two different objects will have different addresses.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Will this c++ program execute or not?

779


What are the various storage classes in C++?

836


What is main function in c++ with example?

782


When the constructor of a base class calls a virtual function, why doesn't the override function of the derived class gets called?

803


Explain linear search.

814






what is a class? Explain with an example.

853


Explain rtti.

774


What is std :: endl?

772


If there are two catch statements, one for base and one for derived, which should come first?

752


What are stacks?

798


What is the difference between an external iterator and an internal iterator?

829


What are the extraction and insertion operators in c++? Explain with examples.

872


Write is a binary search tree? Write an algo and tell complexity?

782


Can comments be nested?

795


What is the use of register keyword with the variables?

727