![]() |
CITS2002 Systems Programming |
← prev | next → | ![]() |
![]() |
|||
Function OverloadingIn C11, if we wish to perform very similar operations, but on different datatypes, we need to define multiple functions, with different (but similar) names.
In contrast, C++ supports function overloading
which permits functions with the same name
to support different parameter types and different return types.
The C++ compiler recognises that the multiple functions are strongly related, and calls the correct function (generates the correct instructions) depending on how the functions are called (i.e. with what parameter types).
CITS2002 Systems Programming, Lecture 23, p3, 17th October 2023.
|