warning: string literal in condition

后端 未结 4 1395
野性不改
野性不改 2021-02-05 08:49

Using the first bit of code below I receive two warning messages: warning: string literal in condition x2

if input == \"N\" || \"n\"
  #do this
else         


        
4条回答
  •  无人共我
    2021-02-05 09:37

    I have the same error as you but a different problem, found this through Google might as well post my solution for the next Googler.

    I had a typo in my code which also gives the same warning:

    if input =! "N"
    

    of course the right way:

    if input != "N"
    

提交回复
热议问题