I am having confusion with the return value of post-increment and pre-increment operator.Whether it returns r-value or l-value.
#include<iostream>
using namespace std;
int main(){
int a=10;
cout<<++a++<<"
";
}
The following code give a compile error.
error: lvalue required as increment operator
Why is there an error?
How does the compiler evaluates the expression ++a++
?