![]() |
CITS2002 Systems Programming |
← prev | next → | ![]() |
![]() |
|||
Classes with methods defined externally, continuedHere, the class's methods are defined 'away' from their declarations in the header file. Thus, we need to preface each method name with the name of class to which it belongs. To ensure that the defintions are type-compatible with the class's declarations, we use the preprocessor to include the class definition:Here, we can think of Point as the namespace to which the methods belong:
CITS2002 Systems Programming, Lecture 23, p7, 17th October 2023.
|