Syntax Error "=="

Viewed 400

this is part of my code to my game engine that I am working on. When I build/debug the code, it stops with a compiler error: "Camera.cpp(70): error C2059: syntax error : '==' " and line 70 is the

if ( near == far ) line. It also happens on line 75:

(if near == NULL || far == NULL)

bool Camera::SetClippingPlanes( float near, float far )
{
    if (near == far)  //Line 70(First Error)
    { 
        MessageBox(NULL, L"ERROR: The far and near clipping planes cannot be equal!", L"Error", MB_OK | MB_ICONERROR);
        return false;
    }
    else
    {
        if (near == NULL || far == NULL)  //Line 75(Second Error)
        {
            MessageBox(NULL, L"ERROR: Near and/or Far clipping planes are null!", L"Error", MB_OK | MB_ICONERROR);
            return false;
        }
        else
        {
            nearPane = near;
            farPane = far;
            return true;
        }
    }
}

I have other functions which use the == operator in the same way, but they do not receive an error. Thanks if you have any suggestions...

3 Answers
Related