Next: Function Declarations, Up: Functions [Contents][Index]
We have already presented many examples of function definitions. To summarize the rules, a function definition looks like this:
returntype
functionname (parm_declarations…)
{
body
}
The part before the open-brace is called the function header.
Write void
as the returntype if the function does
not return a value.
• Function Parameter Variables | Syntax and semantics of function parameters. | |
• Forward Function Declarations | Functions can only be called after they have been defined or declared. | |
• Static Functions | Limiting visibility of a function. | |
• Arrays as Parameters | Functions that accept array arguments. | |
• Structs as Parameters | Functions that accept structure arguments. |