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

前端 未结 6 882
清酒与你
清酒与你 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:06

    It's pretty intuitive if you think about what side of an assignment operator they can appear:

    left-value = right-value;
    

    Loosely put, lvalue means you can assign to it, rvalue means it can only appear on the right hand side of the operator.

提交回复
热议问题