comparison warning C32

Discussion in 'Programmer's Corner' started by chrisw1990, Apr 19, 2012.

  1. chrisw1990

    Thread Starter Active Member

    Oct 22, 2011
    543
    41
    im trying to do this:
    Code ( (Unknown Language)):
    1.     if((numChar==0) && (character=="$"))
    buti get this warning:
    do i need to worry about it?
    i dont understand why, because im not using a pointer, or integer.. character is a char and the $ is.. a char?
     
  2. MrChips

    Moderator

    Oct 2, 2009
    12,449
    3,368
    change your code to

    Code ( (Unknown Language)):
    1. if((numChar == 0) && (character == '$'))
    single quote is for character
    double quote is for strings
     
    chrisw1990 likes this.
  3. chrisw1990

    Thread Starter Active Member

    Oct 22, 2011
    543
    41
    ahh thanks:D i love how small details cause issues:D
     
Loading...