What is size of a empty class?

Answer Posted / ganesh

when ever an datamember is not the part of the class then default value for object size is 1 byte.
but if int a;
char c;
then it will consume 3 bytes .........

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the difference between an external iterator and an internal iterator? Describe an advantage of the external iterator.

817


What is the basic difference between C and C++?

863


What do you mean by delegate? Can a user retain delegates?

739


What is the full form of dos?

795


What is the best it certification?

849


What parameter does the constructor to an ofstream object take?

848


Explain the difference between c++ and java.

879


How to allocate memory dynamically for a reference?

813


What is extern c++?

751


What is protected inheritance?

823


What is function overloading in C++?

1116


What are its advantages and disadvantages of multiple inheritances (virtual inheritance)?

888


What is a flag in c++?

826


What is object file? How can you access object file?

870


What are structures and unions?

805