often used seldom defined terms: lvalue

后端 未结 8 1795
南旧
南旧 2020-11-27 17:25

What is an lvalue?

8条回答
  •  佛祖请我去吃肉
    2020-11-27 18:25

    The "L" in lvalue is usually described as standing for "location". An lvalue specifies the location of something; as another answerer pointed out, lvalues can typically have their address taken. This is why numeric literals and non-reference function return values are not lvalues.

    The L used to stand for "left" until const was introduced into C++. Const lvalues cannot appear on the left hand side of an assignment.

提交回复
热议问题