Re:A Guide to Undefined Behavior in C and C++
by peppermint_gum on Thursday August 17, 2023 @03:48PM
(#37166985)
>The amazing part about examples like that is people read them, check that the compiler really does work on that basis, and then continue writing things in C++ anyway. Wild.
Well, in modern C++ this code would look like this:
Well, in modern C++ this code would look like this:
Or even simpler: There's no shortage of footguns in C++, but nonetheless, modern C++ is safer than C.