below is a dummy function. i saw something like this somewhere. i didnt understand the return part.
int SomeFunction(int SomeVar)
{
//do the calculations
...
return SomeVar != 0
}
how does the last line work? what does it return?
any help would be greatly appreciated.
This function returns 1 if
SomeVaris nonzero and 0 ifSomeVaris zero.The result of expression
SomeVar != 0is ofbooltype (falseortrue). Abooltype is implicitly converted toint(0 or 1 respectively).