Capítulo 32 . Accepting Arguments

Índice
Determining the Number of Arguments
Retrieving Arguments
Old way of retrieving arguments (deprecated)
Dealing with a Variable Number of Arguments/Optional Parameters
Accessing Arguments
Dealing with Arguments Passed by Reference
Assuring Write Safety for Other Parameters

Determining the Number of Arguments




If the function is not called with two arguments, it exits with an error message. The code snippet above makes use of the tool macro WRONG_PARAM_COUNT , which can be used to generate a standard error message (see
Figura 32-1 ).

Figura 32-1 .




As you can see, it calls an internal function named wrong_param_count() that's responsible for printing the warning. For details on generating customized error messages, see the later section "Printing Information."