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 a .lib file in c++?

568


Differentiate between a pointer and a reference with respect to c++.

695


Write about all the implicit member functions of a class?

596


What is a c++ vector?

590


Define copy constructor.

620






What is the function to call to turn an ascii string into a long?

596


Is python better than c++?

584


How do you flush a buffer in c++?

600


Please explain class & object in c++?

602


Which is not a valid keyword a) public b) protected c) guarded

740


Which operator cannot overload?

541


What is the use of data hiding?

595


Inline parameters : What does the compiler do with the parameters of inline function, that can be evaluated in runtime ?

2014


Differentiate between late binding and early binding.

640


What is searching? Explain linear and binary search.

583