PDA

View Full Version : Left value



baboozadeh
پنج شنبه 19 آبان 1384, 03:55 صبح
آقایون این left value که میگن یعنی چه ؟!؟!؟!؟
right value یعنی چه ؟!؟!؟ :گیج:

اَرژنگ
پنج شنبه 19 آبان 1384, 06:14 صبح
lvalue
Literally an "l value" or "left value." So-called because, in K&R C, an lvalue can appear on the left side of an assignment expression. In standard C or C++, an lvalue is more properly a "locator value" designating an object.

Lvalues are either modifiable or non-modifiable, a concept generally mapping to non-const and const objects, respectively. Their names aside, non-modifiable (const) lvalues cannot appear on the left in an assignment. (Because K&R C does not have the const keyword, all K&R lvalues are modifiable.)

rvalue
Literally an "r value" or "right value." Rvalues always appear on the right side of an assignment statement. Unlike lvalues, which designate objects, rvalues designate values only—at least in C. C++ also has "class rvalues" designating unnamed temporary objects of a constructed (class) type; such objects are conceptually values of that type.

K&R
Shorthand for Brian Kernighan and Dennis Ritchie's book The C Programming Language, first edition. Published in 1978, K&R formed the basis of the ANSI C standard introduced a decade later.