Comparison with string literal results in unspecified behaviour?

前端 未结 4 1269
独厮守ぢ
独厮守ぢ 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条回答
  •  -上瘾入骨i
    2020-12-17 17:50

    You're comparing pointers, not the actual strings. Use C++ string class instead of char* (or check how C strings work).

提交回复
热议问题