Level 3 — Functions
Function signature
Original notes by SunDiaL · View English source
The function name and parameter types form the signature. Two functions cannot have the same signature, as the computer will not know which one to execute. This, in turn, means that it's okay to have two or more functions, as long as their signature is different. This happens in two ways:
- The name is different - no problems here, it's another function
- The name is the same, but the parameter types are different. This is what is known as function overloading.