What is undefined behaviour in C++?
- A Behaviour the standard imposes no requirements on, allowing the compiler to assume it never occurs
- B A runtime error message
- C A compiler warning
- D Platform-specific but well-defined behaviour
Answer
Behaviour the standard imposes no requirements on, allowing the compiler to assume it never occurs
Because the compiler may optimise on the assumption UB cannot happen, symptoms often appear far from the actual defect.





