Take the 2-minute tour ×  I am not getting Why Size of Class
with a member function is 1 byte..While member function is 4
bytes in the following example.  class Test
int m = 0;  int main()      Test t1;     int J = sizeof(t1);
int K = sizeof(t1.Test11());     return 0;  Here J becomes 1
Byte and K becomes 4 bytes. If K=4, then why size of class is
not 4 bytes instead it shows 1 Byte  share|improve this question
What is the actual return type for Test::Test11? Is it a typo
and you meant Test::Test()? The code you posted is not well
formed in that it defines a class with a member function that
has no return type. –  David Rodríguez - dribeas Oct 1 '09 at
6:06 add comment  2 Answers  up vote 12 down vote accepted  The
function itself is not actually stored in the class.  Only the
class's data members (and possibly its vtable pointer, if it has
one) affect its size. The function itself lives in the
executable code region, and all instances of the same type of
class use that one definition of the functi