Why class size depend only on data members and not on member functions?

前端 未结 7 1089
孤城傲影
孤城傲影 2020-12-03 05:42

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

相关标签:
7条回答
  • 2020-12-03 06:13

    Just like a regular C function, a C++ method is just an address in memory for the execution to jump to when called. The only difference is the first parameter, which is a pointer to the object from which you are calling the function.

    0 讨论(0)
提交回复
热议问题