Computer programming/Variables - eMyTextBooks

Search:  

Free online books - just read it!

See live article   •   Computer programming/Variables
 

Computer programming/Variables


This Computer programming article is available in pseudocode and Ada.

Table of contents

Variables are references that stand in for a value that is contained at a certain memory address.

Variables are said to have a value and may have a data type. If a variable has a type, then only values of this type may be assigned to it. Variables do not always have a type.

A value can have many values of many different types: integers (7), ratios (1/2), (approximations of) reals (10.234), complex numbers (4+2i), characters ('a'), strings ("hello"), and much more.

Different languages use different names for their types and may not include any of the above.

Assignment statements

An assignment statement is used to set a variable to a new value.

An assignment statements in wikibook pseudocode is written as 'let variable := value.

 let X := 10

The example set the variable X to the integer value of 10. The assignment statement overwrites the contents of the variable and the previous value is lost.

In some languages, before a variable can be used, it will have to be declared, where the declaration specifies the type.

But this is not needed in wikibook pseudocode.

Uses

Variables store everything in your program. The purpose of any useful program is to modify variables.


Also helps finding: ComputerprogrammingVariables, Computerprogramming, programmingVariables, compter, programing, varibles, comptuer, programmin, variablez, comuter, progamming, computar, prgramming, compuer, programmming

   
 
  
Add to bookmarks
Related Articles
 
Programming:Variables
Computer programming
Top Articles
 
Ada Programming/Keywords/else
Ada Programming/Keywords/end
Ada Programming/Keywords/function
Ada Programming/Keywords/null
Ada Programming/Keywords/out
Ada Programming/Keywords/package
Ada Programming/Keywords/pragma
Ada Programming/Keywords/range
Ada Programming/Keywords/subtype
Cookbook:Cup
Cookbook:Egg
Cookbook:Teaspoon
General Biology
Radiation Oncology:RTOG Trials
SA NCS:Dance Studies
SA NCS:Economy
SA NCS:Home Language
SA NCS:Hospitality Studies
SA NCS:Music
SA NCS:Second Additional Language
South African Curriculum
Search LiveJournal blogs for Computer programming/Variables
 

Credit Consolidation  •  Find jobs  •  Property in America  •  Find jobs •  Submit articles

Copyright @ 2005 eMyTextBooks.com
This article is from Wikibooks. All text is available under the terms of the GNU Free Documentation License.