I am trying to convert a C++ program to C#. I came across a line of statement as below.
int X;
int P = 10;
int Q = 5;
X = P < Q;
It make sense to me if X is a bool value. However X is an integer. I am wondering what the output of X would be. It might be a very basic syntax in C++. Sorry for my ignorance. I am after an equivalent statement in C#. Any advice is appreciated.
Thanks
In C# the assignment would not be permitted, because (as you guessed) the expression
P < Qwould be of the typebool. This C# code would be roughly equivalent: