Custom Search

Variables

Wikipedia tells me that:

'a variable is an abstract storage location paired with an associated symbolic name, which contains some known or unknown quantity of information referred to as a value'

In simpler terms, a variable can be thought of as a 'named container' within the computer. That named container can be accessed and its contents used or viewed and even changed in the course of the program's operation.

There are different types of container. There are ones for a particular types of data - numbers or letters - integer, float, string etc.

A variable can be associated with, or identified by, a memory address.

The variable name is the usual way to reference the stored value, in addition to referring to the variable value itself, depending on the context. This separation of name and content allows the name to be used independently of the exact information it represents.

The identifier in computer source code can be bound to a value during run time, and the value of the variable may be changed when the program is 'run'.

See also static and dynamic typing