Search Results
7/18/2025, 6:28:40 PM
>>105947931
++n is not an rvalue in C++. It's a modifiable lvalue, which is why you can do things like
>++n = 5;
In C, ++n is indeed an rvalue.
n + 1 is always an rvalue in both languages and has no side effects.
So no, ++n and n + 1 are not equivalent, neither in value category nor behavior.
++n is not an rvalue in C++. It's a modifiable lvalue, which is why you can do things like
>++n = 5;
In C, ++n is indeed an rvalue.
n + 1 is always an rvalue in both languages and has no side effects.
So no, ++n and n + 1 are not equivalent, neither in value category nor behavior.
Page 1