ENCYCLOPEDIA 4U .com



Encyclopedia Home Page

Google
  Web Encyclopedia4u.com

 

Value (computer science)

In computer science, a value may be a number, literal string, array and anything that can be treated as if it were a number. The exact definition varies across programming languages. Variables and subprogram calling sitess are mostly treated as values.

The distinction from object is subtle but one can say that objects include referencess while values do not. References, however, are commoly expressed as values too, notablely 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 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'.

This article is a stub. You can help Wikipedia by fixing it.





Content on this web site is provided for informational purposes only. We accept no responsibility for any loss, injury or inconvenience sustained by any person resulting from information published on this site. We encourage you to verify any critical information with the relevant authorities.



Copyright © 2005 Par Web Solutions All Rights reserved.
| Privacy

This article is licensed under the GNU Free Documentation License. It uses material from the Wikipedia article "Value (computer science)".