Google
 
   
Login
Username:

Password:


Lost Password?

Register now!
Search
Main Menu
top books
Polls
What do you think about php-deluxe.net?
Excellent!
Cool
Hmm..not bad
What the hell is this?
encyclopedia
recommendation
compare webbrowser
Freenet DSL
Who's Online
3 user(s) are online (3 user(s) are browsing encyclopedia)

Members: 0
Guests: 3

more...
browser tip
Unix Befehle
manual of unix befehle
recommendation!
Sponsored
partner

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. In other words, label, subprogram, Datatype, inheritance (computer science) and control flow are not values in general. The exact definition varies across programming languages. Variables and subprograms are mostly treated as if they are values.

The distinction from object (computer science) is subtle but one can say that objects include the private memory storage referred to by targets of reference (computer science)s while values are independent of storage and only contain public parts. For example, references are commonly expressed as values, notably a Pointer in C programming language. In C, object references can be represented as a struct that contains a void pointer whose target structure is unknown to client code; the void pointer would refer to an object.

The use of a term value is useful in clarifying the exact meaning of assignment (computer science)s, 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.

=In C: L-value and r-value=

Some languages use the idea of l-value and r-value. L-values are values that have memory address, meaning they are variables or dereferenced references to a 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.

= In assembly language =

A value can be virtually any kind of data by a given data type, for instance a string, a digit, a single letter.

In assembly language there is something known as immediate value (or sometimes immediate for short, occasionally it can be written as imm# where # is a number indicating the size of the imediate value, for instance imm8 would refer to a immediate byte size value). An immediate value is a number (either written with digits (in any by the language accepted manner), or as a string ( mnemonic A could be the same as nmemonic 0x64 , please note that the byte order of strings may differ depending on the assembler an architecture, please consult your assemblers manual for details) ).

A value could also be a reference or pointer (or the data pointed to by a pointer, depending on the context) to another variable or data of a given datatype.

=See also=

*Attribute-Type-Value Object Language

=External links=

*[http://c2.com/cgi/wikiValueObject Value Object] *[http://java.sun.com/blueprints/patterns/TransferObject.html Transfer Object Pattern]