Node:Function names, Next:Function examples, Previous:Functions, Up:Functions
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:
a
to z
A
to Z
0
to 9
_
Note that with GCC, you can also use dollar signs ($
) in
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.