Functions or methods?

后端 未结 6 1370
醉话见心
醉话见心 2021-01-19 14:09

If I\'m writing abstract data types in C, are the functions written to perform actions on these data types and exposed in the interface (.h files) called functions,

6条回答
  •  深忆病人
    2021-01-19 14:45

    Is method a C++ specific term?

    A "method" is an object-oriented programming term, and refers to a function that is part of the namespace of an object. So you can create methods for objects in languages like C++, Java, Objective-C, etc. In C on the otherhand, you still have stand-alone functions, not methods.

    Keep in mind that the "official" C++ term for a class method is a "member function", and is described in section 9.3 of the spec.

提交回复
热议问题