To make things more meaningful, basically for the below two cases.
I somehow imagined them to be similar, right hand side first.
But "=" just passes value through
"==" returns the result of the comparison "true" and then converts to 1.
So they are actually NOT similar?
int hehe = haha = 3;
int hehe = haha == 3;
//-----------------------------------------------
For the following code, can you explain why both haha and hehe are both 3?
I know assignment is right associative. So haha is assigned with 3 first.
But why the result of (haha = 3) is not 1 indicating something like the operation is successful? Instead 3 is propagating all the way to haha? What is the terminology of these two types: 3 propagates all the way vs some operation is successful.
int haha;
int hehe = haha = 3;
cout << haha << hehe;