C# does not define an implicit conversion from int
to bool
. The while
loop condition must be a bool
.
You should use while(count-- != 0)
instead.
In C#
you have a bool
type which accepts True
or False
as value. In C
everything other than 0
is true and 0
indicates null. So you can have if (1)
in C
but 1
is not a logical expression in C#
.