In math = means both sides are equal which in this case is impossible. In most coding languages the = operator assigns a value, in this case adding 1 to x.
U are right in C/C++, when an lvalue is used as the target of an assignment, it must be a modifiable lvalue. Note that initialization (e.g. const int x = 5;) is not assignment, so the rule doesn't apply there.
4
u/LeadLerner 13d ago
Nobody asked for this slop.
1
u/Acceptable-Door-9810 15d ago
I don't get it
1
u/DeviceMajestic6427 12d ago
Tf is ts?
1
u/y-_can 15h ago
x = x + 1 dude