Assignment

What Does Assignment Mean?

An assignment is a statement in computer programming that is used to set a value to a variable name. The operator used to do assignment is denoted with an equal sign (=). This operand works by assigning the value on the right-hand side of the operand to the operand on the left-hand side.

Advertisements

It is possible for the same variable to hold different values at different instants of time.

Techopedia Explains Assignment

A simple assignment statement could be:

int x = 5

This means that x can only take integer values, and currently a value of 5 is assigned to the variable x.

A single variable can hold various values at different times based on its life span and scope. When a variable which is already assigned a value is assigned another value, the new assignment value overwrites the previously assigned
value. The assignment statement also varies from programming language to programming language.

Advertisements

Related Terms

Latest Programming Languages Terms

Related Reading

Margaret Rouse

Margaret Rouse is an award-winning technical writer and teacher known for her ability to explain complex technical subjects to a non-technical, business audience. Over the past twenty years her explanations have appeared on TechTarget websites and she's been cited as an authority in articles by the New York Times, Time Magazine, USA Today, ZDNet, PC Magazine and Discovery Magazine.Margaret's idea of a fun day is helping IT and business professionals learn to speak each other’s highly specialized languages. If you have a suggestion for a new definition or how to improve a technical explanation, please email Margaret or contact her…