Consider the following code:
#include <iostream>
struct Foo
{
Foo() : bar( 0 ) {}
int bar;
};
int main()
{
Foo foo;
++(foo.bar);
std::cout<< foo.bar << std::endl;
system("pause");
return 0;
};
Why does foo.bar
evaluate to 1?
Doesn't the parentheses in (foo.bar)
create an unnamed (r-value) expression which is then incremented?