Can you use sizeof on a class? If so, does only depend on its primitive values or does inheritance play a part as well? | SoloLearn: Learn to code for FREE!

+1

Can you use sizeof on a class? If so, does only depend on its primitive values or does inheritance play a part as well?

4/13/2016 12:12:00 AM

Antonio Borges

3 Answers

New Answer

+8

sizeof works on objects. It returns the size occupied by the object in memory. So, all the data connected with the object is taken into account.

0

Yes.....We find these in file handling.....when we started saving information by classes

0

yes it depends on inheritance....because it is accessing data from them