Howdy, Stranger!

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

Categories

Here's an easy one....

donkyhodonkyho Member Posts: 99
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

  • stoberstober Member Posts: 9,765 ✭✭✭

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

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


  • donkyhodonkyho Member Posts: 99
    :
    : 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
  • Andre YoungAndre Young USAMember Posts: 0

    _________ | http://forcoder.org | free video tutorials and ebooks about [ C, R, Objective-C, Delphi, MATLAB, Visual Basic, PL/SQL, Python, C++, C#, Swift, JavaScript, Perl, Ruby, Visual Basic .NET, PHP, Java, Go, Assembly, Scratch Kotlin, Logo, FoxPro, Lua, Ada, Dart, ML, Scala, Alice, VBScript, Fortran, Bash, Transact-SQL, Julia, LabVIEW, Apex, Rust, SAS, Clojure, Prolog, Erlang, ABAP, Crystal, Lisp, D, Awk, Scheme, Hack, F#, COBOL ] _________

Sign In or Register to comment.