A structured lesson workspace with readable content, hands-on examples, and a clean path to completion.
An lvalue is an expression that refers to a memory location. You can take its address with &. You can assign to it. A variable is an lvalue. A dereferenced pointer is an lvalue. An array element is an lvalue. An rvalue is a temporary value with no persistent address. A literal is an rvalue. The result of an arithmetic expression is an rvalue. You cannot assign to an rvalue. You cannot take its address. The compiler enforces this. Understanding the distinction explains a whole category of error messages.
#include <stdio.h>int main(void) {int x = 10;int *p = &x;x = 20;*p = 30;int arr[3] = {1, 2, 3};arr[1] = 99;printf("x=%d, *p=%d, arr[1]=%d\n", x, *p, arr[1]);return 0;}
x, *p, and arr[1] are all lvalues. They designate memory locations. You can write to them. You can take their addresses. Now the errors.
#include <stdio.h>int main(void) {42 = 10;(3 + 4) = 7;int x;&x = NULL;return 0;}
Three errors, all saying "lvalue required as left operand of assignment." 42 is a literal. It has no address. You cannot store a value into the concept of forty-two. (3 + 4) is a temporary result. It exists in a register, not in a named memory location. &x is the address of x, which is itself an rvalue (a temporary pointer value). You cannot assign to it. The compiler rejects all three.
An array name is an lvalue in some contexts but not a modifiable lvalue. You can take its address: &arr is valid. You cannot assign to it: arr = other_arr is an error. The array name designates the storage, but you cannot reassign where it points. It is not a pointer variable. It is a fixed alias for a fixed block of memory.
The lvalue/rvalue distinction is the grammar of assignment. It tells you what can receive a value and what can only provide one. The error message "lvalue required" is the compiler telling you that you are trying to write to something that is not writable. Operators module complete. Next: the standard library deep-dive, where we spend 39 lessons mastering the functions that ship with every C compiler.
Finish the lesson once you have worked through the material. This awards ★ 30 XP.