CS0019 Operator cannot be applied to operands of type 'bool' and 'int'
You can't write (q == 1)
in C#, because q
is a bool
and 1
is an int
.
q
can only be compared to another boolean expression, e.g. true
, false
, another boolean variable, etc.
Just if someone read this question and needs comparing a bool
with an int
:
(Convert.ToInt32(q) == 1)