what is the size of an empty class

Answers were Sorted based on User's Feedback



what is the size of an empty class..

Answer / hardit singh

size of an empty class is 1 byte

Is This Answer Correct ?    32 Yes 3 No

what is the size of an empty class..

Answer / muniskehar

size of an empty class is 1Byte

Is This Answer Correct ?    7 Yes 1 No

what is the size of an empty class..

Answer / manu

1 byte it 100% correct ans dont get confuse

Is This Answer Correct ?    5 Yes 2 No

what is the size of an empty class..

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

what is the size of an empty class..

Answer / asdf

According to the standard C++03, all classes "shall have
nonzero size."

1 byte is the most common implementation but it is left up
to the vendor.

Is This Answer Correct ?    2 Yes 0 No

what is the size of an empty class..

Answer / padma

Size of an empty class is 0.

Is This Answer Correct ?    0 Yes 0 No

what is the size of an empty class..

Answer / ankit sharma

size of empty class is 1 byte.


if object does not point to any resource.
it shows object is null but object also get some space in
memory by default either it is empty or not.

Is This Answer Correct ?    0 Yes 0 No

what is the size of an empty class..

Answer / ansari razi

1 Byte,
when compiling the program compiler allocates 1 byte memory.

Is This Answer Correct ?    0 Yes 0 No

what is the size of an empty class..

Answer / kaush

1 byte for empty class before assigning the value

Is This Answer Correct ?    0 Yes 1 No

what is the size of an empty class..

Answer / p.madhupriya

1 byte or 0

Is This Answer Correct ?    1 Yes 2 No

Post New Answer

More OOPS Interview Questions

which structured data type is not used in c++? 1.union 2.structure 3.string 4.boolean

2 Answers   HCL, Wipro,


When not to use object oriented programming?

0 Answers  


What is difference between function overloading and overriding?

1 Answers   emc2,


write a program to find the largest of two numbers without using for,while,switch,if else, conditional operator and do while using c++ pgmng language

3 Answers   Satyam,


Can an interface inherit a class?

0 Answers  






what is the use of template classes in c++

1 Answers  


What are the advantanges of modularity

2 Answers  


what is the difference b/w abstract and interface?

2 Answers   Merrill Lynch, Schneider, Scio Healthcare,


What do you mean by inheritance?

0 Answers   IBS,


C#.net Interview Question A=10 B=5 C=A+B Print C The above will be given in a multiline textbox. You need to parse the above input, store values for A,B&c. And you have to display the value of C.

1 Answers   Syncfusion,


write a code for this:trailer recordId contains a value other than 99, then the file must error with the reason ‘Invalid RECORD_ID’(User Defined Exception).

0 Answers  


WILL I GET A guaranteed JOB AFTER DOING bsc()IT) and GNIIT from an NIIT CENTRE??

21 Answers   Biocon, MIT, NIIT,


Categories