Comparison with string literal results in unspecified behaviour?

前端 未结 4 1258
独厮守ぢ
独厮守ぢ 2020-12-17 17:45

I am having a problem with the program I am trying to code. It\'s just a Windows console program and I am very new to C++. It\'s only my 4th program.

The problem I a

4条回答
  •  囚心锁ツ
    2020-12-17 17:56

    Just a little thing that got me stumbling for a bit, is the difference between single and double quotes, see: Single quotes vs. double quotes in C or C++

    I was comparing the first character of a string with double quotes and not single quotes - which resulted in above's error message.

提交回复
热议问题