It is possible to combine boolean expressions with a comma separator. I have seen it in a code and i am not sure what this resolves to. I wrote some sample code.
int BoolStatement(void)
{
using std::cout;
using std::endl;
cout << "(0, 0) => " << (0, 0) << endl;
cout << "(0, 1) => " << (0, 1) << endl;
cout << "(1, 0) => " << (1, 0) << endl;
cout << "(1, 1) => " << (1, 1) << endl;
cout << "(0, 0) => " << (0, 0) << endl;
cout << "(0, 3) => " << (0, 3) << endl;
cout << "(5, 0) => " << (5, 0) << endl;
cout << "(7, 1) => " << (7, 1) << endl;
cout << endl;
return 0;
}
The output of this is:
(0, 0) => 0
(0, 1) => 1
(1, 0) => 0
(1, 1) => 1
(0, 0) => 0
(0, 3) => 3
(5, 0) => 0
(7, 1) => 1
I am not sure if that is only true for my system and if this call is actually the same as a boolean combination of statements.
What is the output, is it the same on all systems? Why is that statement possible and is there documentation on it?
0
,1
,3
, etc. are integers, not booleans.