web analytics

Rules for Naming Variables 1

Follow these rules when naming variables:

  • A variable name must be of the form $name or ${name}.
  • The string name can consist of letters (a-z and A-Z), numbers (0-9), and underscore characters (_).
  • The first character of name must be an alphabetic character (a-z or A-Z).
  • If the ${name} form is used, spaces can also appear in name. This allows you to use multiple word names without the underscore character.
  • C language is case sensitive so best practice is have lower case of variable names.
  • Reserved names can’t be variables.

Site last updated May 22, 2013 @ 3:30 pm; This content last updated February 21, 2013 @ 2:40 pm