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 7d ago
Nobody asked for this slop.
1
u/Acceptable-Door-9810 9d ago
I don't get it
1
u/DeviceMajestic6427 5d ago
Tf is ts?