Glossary: lvalue

An lvalue is a value that can be modified i.e. a value that can appear on the left of an assignment (hence lvalue).
MyInt = 3;
is O.K. because MyInt is an lvalue, but
3 = MyInt;
isn't because 3 isn't. In C++ all manner of expressions, including function calls, can yield lvalues that can be assigned to. This can be a bit of a shock for a FORTRAN programmer only used to assignments to variables and array elements. For example, a dereferenced pointer and a reference can both be lvalues.
See OO Concepts: Pointers & References
Go Back to the The Glossary Top Page

If you have any comments about this page please send them to Nick West