Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com
Answertopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions
Privacy Policy

  




 

 

The GNU C Programming Tutorial - Function names

Node:Function names, Next:, Previous:Functions, Up:Functions



Function names

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 a to z
  • Any upper-case letter from A to Z
  • Any digit from 0 to 9
  • The underscore character _

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.

 
 
  Published under free license. Design by Interspire