0 votes
in GoLang by
What are Lvalue and Rvalue in Golang?

1 Answer

0 votes
by

Lvalue

  • Refers to a memory location
  • Represents a variable identifier
  • Mutable
  • May appear on the left or right side of the = operator
  • For example: In the statement x =20, x is an lvalue and 20 is an rvalue.


  •  

Rvalue

  • Represents a data value stored in memory
  • Represents a constant value
  • Always appears on the = operator’s right side.
  • For example, The statement 10 = 20 is invalid because there is an rvalue (10) left of the = operator.

Related questions

0 votes
0 votes
asked Apr 27, 2023 in GoLang by Robin
0 votes
0 votes
asked Aug 11, 2022 in GoLang by SakshiSharma
...