ISO C++ forbids comparison between pointer and integer [-fpermissive]

Here is the code..why am i not able to set true to a function I defined as check_the_result? when I set the == to false it does not give me an error, only when set to true.

if(check_the_result == true)
{
palin(Result);

}
else
{
cout<<Result<<endl;
}

if you need to see more of the code please tell me
Thanks to all
Last edited on
Since check_the_result is the name of a function, you need to call the function and do the comparison on the returned value. On its own, the name of the function here is interpreted as a pointer to the function.

For example
 
if (check_the_result(parameters here as required) == true)
Last edited on
oh okay haha stupid mistake..thanks for pointing that out! I was trying to figure out what was wrong for a while. its compiling and there are no errors now, but why would it compile with no errors when i changed the true to false?
Last edited on
Others may have a better and more correct explanation. However, false is probably interpreted as zero in this context, and comparing an address with zero would be valid.
Topic archived. No new replies allowed.