How to spot undefined behavior

后端 未结 10 577
梦毁少年i
梦毁少年i 2021-01-11 11:45

Is there any way to know if you program has undefined behavior in C++ (or even C), short of memorizing the entire spec?

The reason I ask is that I\'ve noticed a lot

10条回答
  •  没有蜡笔的小新
    2021-01-11 12:21

    Simple: Don't do things that you don't know that you can do.

    • When you are unsure or have a fishy feeling, check the reference

提交回复
热议问题