this is a very very basic question but while coding i got stuck.
in c++ we use the statement:

if (back_tracking(0, y + 1))

to check some condition but while coding in c# it says cannot convert implicitely int to bool!
anybody kindly tell me whats the workaround in c#

Re: if condition in c# 80 80

In C, anything that is not zero is true, while zero is false. C# doesn't work that way and requires a boolean value for conditionals. So you need to compare that to something

if (back_tracing(0, y + 1) != 0) {
    // true, do whatever
Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.19 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.