Jump to content

Assignment

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by AlexPlank (talk | contribs) at 13:23, 23 January 2004 (assignment). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)

In computer programming, an assignment is the defining of a variable. In C++ and many other languages, a variable must first be declared before assignment.

int x=10; 

In this sample C++ code segment, the variable x is first declared as an int, and is then assigned the value of 10.

Languages such as Perl do not require variables to be declared before an assignment is made.