24. Do methods affect to the size of an object?

24. Do methods affect to the size of an object?
Nusrat NuriyevAsked:
Who is Participating?
 
jkrConnect With a Mentor Commented:
The answer is: No. No matter of how many methods a class has, the size is only determined by the data members.

With one notable exception: If you have only one method that is declared as 'virtual', the compiler will add a pointer to a Virtual Method Table, which will increase the class' size by 4 bytes (32bit) or 8 bytes (64 bits).
0
 
Nusrat NuriyevAuthor Commented:
how can I see the content of virtual method table? is there any tool for developers?
0
All Courses

From novice to tech pro — start learning today.