O'Reilly logo

Sams Teach Yourself C++ in 24 Hours, Third Edition by Jesse Liberty

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Operators

An operator is a symbol that causes the compiler to take an action.

Assignment Operator

An operand that can legally be on the left side of an assignment operator is called an l-value. An operand that can be on the right side is called (you guessed it) an r-value.

Constants are r-values; they cannot be l-values. Thus, you can write

x = 35;          // ok

but you can't legally write

35 = x;          // error, not an l-value!

An l-value is an operand that can be on the left side of an expression. An r-value is an operand that can be on the right side ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required