4

I am trying to understand lvalue expressions.

In the following link cppreference-value-categories I read the following statement under the 'lvalue' section.

The following expressions are lvalue expressions:

a string literal, such as "Hello, world!";

Could someone explain why this is an lvalue rather than a rvalue?

πάντα ῥεῖ
  • 1
  • 13
  • 116
  • 190
Nujufas
  • 676
  • 1
  • 9
  • 19
  • 2
    String literals are really constant arrays of characters, and can therefore be used much like other (constant) arrays in your program (including getting their address taken with the address-of operator `&`). – Some programmer dude Apr 23 '19 at 10:38

0 Answers0