Using the C++ Math Library | ![]() ![]() |
Function Calling Conventions
MATLAB and C++ have different function calling conventions. In MATLAB, a function declaration establishes a function's name. The declaration says nothing about the number and type of the inputs and outputs to the function. In C++, a function declaration does specify the number and type of the input arguments and the type of the return value.
In addition, in C++ a function can return at most one value whereas MATLAB functions can return more than one value. Functions in the MATLAB C++ Math Library emulate their MATLAB counterparts that have multiple return values by returning one value as the return from the function and storing the rest of the values in output arguments supplied by the caller.
For complete details on the library's calling conventions, see How to Call C++ Library Functions in Chapter 5.
![]() | Variable Declaration | Control Structure | ![]() |