c++: Difference between member and non member functions

前端 未结 6 879
一整个雨季
一整个雨季 2020-12-12 20:35

What is the difference between member and non-member functions in C++?

6条回答
  •  时光说笑
    2020-12-12 21:26

    A member function is invoked on an object and has access to the fields of the class.

    Member functions can be polymorphic (via the virtual keyword) which is essential for OOP.

提交回复
热议问题