Open main menu

Wikibooks β

Changes

Computer Programming/Variables

861 bytes added, 14 years ago
no edit summary
Variables are letters that stand in for a value that is contained at a certain memory address.
Variables will contain data and a data type. The data can be any series of numbers, of the type integers (2) or of the type reals (2.4), or of the type characters ("hello"). Different languages though have different type names, and some allow you to make new types.
A variable can be set equal to its data, usually with an = or := sign.
Before a variable can be used, it will in some languages have to be declared, where the declaration specifies the type.
The address of the variable, in many languages, can be accessed in order to pass the address to another variable so that each variable points to the same data, or in some languages so that the address can be used as a starting point so more than one value can be stored.
== Uses ==
Variables store everything in your program. The object of any useful program is to modify variables.
== Language Specifics ==
74
edits