What is the reasoning behind the naming of “lvalue” and “rvalue”?

前端 未结 6 883
清酒与你
清酒与你 2021-01-16 07:30

What is the reasoning behind the naming of \"lvalue\" and \"rvalue\" in C/C++ (I know how they function)?

6条回答
  •  自闭症患者
    2021-01-16 08:05

    In C, lvalue and rvalue reflect the usage in the assignment operator. rvalue can appear only to the right of =, while lvalue can be on either side. In C++ it's similar, but more complicated.

    There are non-assignable lvalues, constant variables.

提交回复
热议问题