ISO C++ forbids Comaprison

I keep getting the following error. in the following code…

Arduino: 1.6.8 (Windows 10), Board: "Arduino/Genuino Uno"

sonar:87: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]

     if( frontLeft < safeTurn && frontLeft != 0){

                      ^

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

I cant see why it thinks i am comparing a pointer and a integer , safeTurn is defined gloabaly. frontLeft is given value at the start of this function.

Anymore questions or it is unclear please ask thnaks for any help given in advance.

It seems that you forgot to post the code that generates the error. Is frontLeft or safeTurn an array?

I have found the problem by following the cascade of the problem back , to the main loop.

I had said in the main loop " check == true" Where as check was a function required "check () == true".

If anyone can explain why it thought the error was so randomly chosen in the code rather then the actual problem that would be great!

Reuyj: I have found the problem by following the cascade of the problem back , to the main loop.

I had said in the main loop " check == true" Where as check was a function required "check () == true".

If anyone can explain why it thought the error was so randomly chosen in the code rather then the actual problem that would be great!

myFunction();  // is a function
if( myFunction == true) // myFunction degrades to a pointer to a function

If anyone can explain why it thought the error was so randomly chosen in the code rather then the actual problem that would be great!

Without seeing your code? Not a chance.