7. Variable assignment

Variables are assigned by means of the assignment operator =. The assignment statement must be enclosed by parentheses. Example:


will assign the value 3 to the variable i.

Variable names begin with an alphabetical character (a-z, A-Z), followed by zero or more alphanumeric and/or underscore (_) characters.

The value that will be assigned to the variable is evaluated from the expression that follows the assignment operator. From the expression's type, the type of the variable is inferred.

The operator ?= assigns only if the variable has not already been assigned. In conjunction with the -define command-line option, it can be used to specify default values that can be overridden on the command line:


This is identical to the following:

if (not isdefined(eltype)) {