Home Segments Index Top Previous Next

40: Mainline

A C identifier is a name consisting of letters and digits, the first of which must be a letter; underscore, _, counts as a letter.

A variable is an identifier that serves as the name of a chunk of computer memory. Thus, each variable refers to a chunk of memory.

The variable's data type determines the size of the chunk and the way the bits in the chunk are interpreted. If the variable belongs to the int data type, a kind of integer, the chunk of memory involved is likely to contain 32 bits, which collectively determine the integer's sign and absolute value.

The chunk of memory named by a variable is said to hold that variable's value. As a program runs, a variable's value may change, but a variable's data type never changes. Thus, the value of an integer variable named size could be the integer 600 at one time and the integer 200 at another, but size's value could never be a floating-point number—a number that includes a decimal point—such as 10.2.