Lecture overview -- Keyboard shortcut: 'u'  Previous page: The general notation of objects in C++ -- Keyboard shortcut: 'p'  Next page: C-style strings -- Keyboard shortcut: 'n'  Lecture notes - all slides and notes together  slide -- Keyboard shortcut: 't'  Help page about these notes  Alphabetic index  Course home  Lecture 2 - Page 11 : 42
Notes about C++
Basic facilities
Lvalues

An object is "something in memory"

An lvalue is an expression that refers to an object

Thus, an lvalue is an expression that refers to a memory location. You can take the address of that memory location with the address operator.

  • The C++ Programming Language: Page 84
 

  • Lvalues

    • Named after expressions that can occur at the left-hand side of an assignment

    • As such, lvalues are typically modifiable

    • Constant lvalues do also occur in C++ (in the context of so-called const references, §5.5)

  var = 7;
  tab1[3] = 8;
  *(tab2 + 4) = 9;
  tab3[0].x = 2.0;

Examples of lvalues.