Every function has a name by which it is known to the rest of the program. The name of a function in C can be anything from a single letter to a long word. The ANSI Standard, however, only guarantees that C will be able to distinguish the first 31 letters of identifiers, or function and variable names. (Identifiers are therefore said to have 31 significant characters.) In some cases, identifiers may have as few as six significant characters, to stay compatible with older linkers, but this part of the ANSI Standard is becoming obsolete.
A function name must begin with an alphabetic letter or the underscore
_ character, but the other characters in the name can be chosen
from the following groups:
- Any lower-case letter from
- Any upper-case letter from
- Any digit from
- The underscore character
Note that with GCC, you can also use dollar signs (
identifiers. This is one of GCC's extensions to the C language, and is
not part of the ANSI standard. It also may not be supported under GCC on
certain hardware platforms.