September 2018
Intermediate to advanced
328 pages
9h 10m
English
You may have noticed that the descriptions of ccall() and cwrap() specified that both are used to call a compiled C function. The omission of C++ was intentional because an additional step is needed to call functions from a C++ file. C++ supports function overloading, which means that you can use the same function name multiple times, but pass different arguments to each one to get a different result. Here's an example of some code that uses function overloading:
int addNumbers(int num1, int num2) { return num1 + num2;}int addNumbers(int num1, int num2, int num3) { return num1 + num2 + num3;}int addNumbers(int num1, int num2, int num3, int num4) { return num1 + num2 + num3 + num4;}// The function will return a value ...Read now
Unlock full access