I am feeling very stupid to asking this question. but cant figure out the reason on my own.
int main()
{
int target;
int buffer =10;
const int source = 15;
target = (buffer+=source) = 20;
cout << target+buffer;
return 0;
}
target = (buffer+=source) = 20;
will become target = (25) = 20
.
But if I am giving same statement in my source file, it is giving l-value error.
How the value of target+buffer
is printing 40.