Assignment Operator - Research Article from World of Computer Science

This encyclopedia article consists of approximately 2 pages of information about Assignment Operator.

Assignment Operator - Research Article from World of Computer Science

This encyclopedia article consists of approximately 2 pages of information about Assignment Operator.
This section contains 421 words
(approx. 2 pages at 300 words per page)
Buy the Assignment Operator Encyclopedia Article

The assignment operator in a computer language takes the value of an expression and copies it to a variable. In most languages it is denoted by the familiar mathematical symbol "=", but in some languages, like Pascal, it is denoted by the symbol ":=", which roughly means "becomes equal to." To distinguish "assignment" from "equivalence" (which in mathematics both use "="), most programming languages use the symbol "==". So "a = b" makes "a" take on the value of "b"; "a == b" checks to see if "a" and "b" are equal.

In general the semantics of the assignment operator is: modifiable object = expression. The value of the expression is placed in the modifiable object's data area. A typical example of valid assignment statements in C, C++, and Java is:

  • int myInt = 3;
  • int myOtherInt = myInt;

The second form of assignment operator is the "compound assignment," which takes the form: modifiable object = expression...

(read more)

This section contains 421 words
(approx. 2 pages at 300 words per page)
Buy the Assignment Operator Encyclopedia Article
Copyrights
Gale
Assignment Operator from Gale. ©2005-2006 Thomson Gale, a part of the Thomson Corporation. All rights reserved.