I want to know the detail description on the size of a class. I want to know if there is only data members & member function without any virtual keyword then why the cla
Because the function state leaves in the stack, and gets created / deleted upon function entering / exiting.
In the size of the object there are just the members that contributes to the storage of the object state. A function is just a piece of code that starts at a given point that does not depend on the particular object instance it refers to.
Think to
A a1, a2;
a1.a and a2.a are different, but a1.display() and a2.dispaly() is the same function code
(think to int A::display()) as int display(A* this))