I have some code in an old desktop app, which I inheritted from a colegue who left the company. Here is a short similar example of the actual code I have:
#include <iostream>
int getType(int type)
{
return type;
}
int main()
{
int variable1 = 30;
int variable2 = 40;
int result = (getType(30) == (variable1 || variable2) ? 1 : 2);
std::cout << result << std::endl;
}
For the result I always receive 2, not 1 as I expected. If I try:
int result = (getType(30) == (variable1) ? 1 : 2)
the result is true.
I can't figure out why this part:
int result = (getType(30) == (variable1 || variable2) ? 1 : 2)
is not true...