Creating Function Prototypes

Refer to these guidelines when defining function prototypes:

  • Always place function prototypes in the header file of the business function in the appropriate prototype section.

  • Include function definitions in the source file of the business function, preceded by a function header.

  • Ensure that function names follow the naming convention defined in this guide.

  • Ensure that variable names in the parameter list follow the naming convention defined in this guide.

  • List the variable names of the parameters along with the data types in the function prototype.

  • List one parameter per line so that the parameters are aligned in a single column.

  • Do not allow the parameter list to extend beyond 80 characters in the function definition. If the parameter list must be broken up, the data type and variable name must stay together. Align multiple-line parameter lists with the first parameter.

  • Include a return type for every function. If a function does not return a value, use the keyword void as the return type.

  • Use the keyword void in place of the parameter list if nothing is passed to the function.