Tutorial by Topics: undefined

In C, some expressions yield undefined behavior. The standard explicitly chooses to not define how a compiler should behave if it encounters such an expression. As a result, a compiler is free to do whatever it sees fit and may produce useful results, unexpected results, or even crash. Code that i...
What is undefined behavior (UB)? According to the ISO C++ Standard (§1.3.24, N4296), it is "behavior for which this International Standard imposes no requirements." This means that when a program encounters UB, it is allowed to do whatever it wants. This often means a crash, but it may si...
More examples on how C++ can go wrong. Continuation from Undefined Behavior

Page 1 of 1