mercredi 2 septembre 2015

C++ Comparing Two Integer Values, one simple and one pointer

I have the following function in c++:

bool compareThem(int top_limit, int* maximum)
{
       if( top_limit >= maximum )
       {
            cout << "Error, maximum number shown be greater than top_limit.";
       }
}

I want a simple comparison between the integer and integer pointer, though, logically C++ cannot do it, since with == operator, int and int* are not of the same type. How should I then solve it?

Aucun commentaire:

Enregistrer un commentaire