Value_(computer_science) Value_(computer_science)

Value (computer science) - Definition and Overview

In computer science, a value may be a number, literal string, array and anything that can be treated as if it were a number. In other words, label, subprogram, datatype, inheritance and control flow are not values in general. The exact definition varies across programming languages. Variables and subprogram calling sites are mostly treated as values.

The distinction from object is subtle but one can say that objects include references while values do not. References, however, are commonly expressed as values too, notably a pointer in C programming language. You may conclude that In C, therefore there is no difference between objects and values.

The use of a term value is useful in clarifying the exact meaning of assignments, copying, and comparison of objects. In the value model, for instance, objects itself are copied instead of references to it, they are treated as if they were numbers.

L-value and r-value

Some languages use the idea of l-value and r-value. L-values are values that have addresses, meaning they are variables or dereferenced references to certain place. R-value is either l-value or non-l-value — a term only used to distinguish from l-value. In C, the term l-value originally meant something that could be assigned (coming from left-value, indicating it was on the left side of the = operator), but since 'const' was added to the language, this now is termed a 'modifiable l-value'.


An lvalue is an expression that designates (refers to) an object. A non-modifiable lvalue is addressable, but not assignable. A modifiable lvalue allows the designated object to be changed as well as examined. An rvalue is any expression that isn't an lvalue, it refers to a data value that is stored at some address in memory.

See also

  • Attribute-Type-Value Object Language

External links

Example Usage of (computer

chiefn001: Need your computer fixing, software or some advice? http://www.actnowpc.co.uk
GQin11: RT:@KevinHart4real I hope none of my family follows me on twttr b/c I'm abt 2 tell ya'll sum deep shit! I hid my "I pod" & my "Computer"-lol
AlEeSaMaRiE00: sittin here workin on the computer my sisters broke the f key off of it
Copyright 2009 WordIQ.com - Privacy Policy  :: Terms of Use  :: Contact Us  :: About Us
This article is licensed under the GNU Free Documentation License. It uses material from the this Wikipedia article.