Here's an easy one....

here's my warning...

"warning C4018: '<=' : signed/unsigned mismatch"

here's the line of code....

if( handNo > 0 && handNo <= m_pHands.size() )

handNo is a short, m_pHands is a vector...can someone tell me how to get rid of this warning without using a pragma warning disable? or is that the only way I can?

thanks

Comments


  • either type-cast it or change the data type of one of those two variables.

    if( handNo > 0 && handNo <= (short)m_pHands.size() )


  • :
    : either type-cast it or change the data type of one of those two variables.
    :
    : if( handNo > 0 && handNo <= (short)m_pHands.size() )
    :
    :
    :
    thanks, I realize what the problem is...I changed handNo to unsigned short
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories