1.2.4 Function declarations

A function must give proper notification of what kind of data type it
returns, if any. A function is a label much like a variable name,
consisting of < 32 characters, starting with a letter. Custom
and common sense dictate that all function names should be lowercase and
only contain the special character '_' to separate words. Use function
names that clearly reflect on what they do. A function declaration looks
like this:

The argument list is a comma-separated list of data types, much like a
variable declaration where you specify what kind of data will be sent to
the function and assign names to this data for later use in the function.
The data received will only be usable inside the function, unless you
explicitly send it out through a function call.

(In order to save space and improve on legibility in the manual I won't
put a header to all my short example functions).

A function that doesn't return anything should be declared as void.

void
write_all(string mess)
{
users()->catch_msg(mess);
}

This document was generated
by Ronny Wikh on July, 8 2003
using texi2html