Variables

A variable is a piece of computer memory that can hold values according to its type.

Parts

  • Name
  • Type
  • Value

Name

The variable name is an identifier. This identifier can later be used to refer to the variable.

Type

The type of the variable specifies which values it can hold.

For more information about types, see types.

Value

The value held by the variable is one of the values allowed by the typ.

Accessing a variable

For more information on accessing the values of variables, see the variable access operator in sturctural operators.