Lvalues and Rvalues

This lesson explains the difference between the lvalues and rvalues, limitations of rvalues and how both can be passed as parameters to functions.

The difference between lvalues and rvalues #

The value of every expression is classified as either an lvalue or an rvalue. A simple way of differentiating the two is thinking of lvalues as actual variables (including elements of arrays and associative arrays) and rvalues as temporary results of expressions (including literals).
As a demonstration, the first writeln() expression below uses only values, and the other one uses only rvalues:

Get hands-on with 1200+ tech skills courses.