Why this matters
In C++, your code can compile and still be unsafe. It may pass your sample test, then crash on a judge, a friend’s laptop, or during a demo.
This lesson is about avoiding the common break points first: bad input handling, out-of-range access, uninitialised values, and integer surprises.
One rule
Do not trust memory, input, or indexes by default. Check sizes, initialise values, and make invalid states hard to reach.
Safe C++ is not fancy C++. It is boring code that behaves the same way every time you run it.