I’m learning c++, and I wanted to know whether the statement
"if(counter)" is the same as "if (counter!=0)"
>Solution :
If counter is a built-in primitive type (int, double, pointers), yes, it means the same thing. If it’s not a primitive type, they could mean completely different things (whatever operator bool and the comparator defined for comparing with something implicitly convertable from int happen to return).