I've heard lots of times that phrase of Bjarne Stroustrup "C++ makes it harder to shoot yourself in the foot; but when you do, it takes off the whole leg" and I don't really know if it is as terrible as it sounds.
What's the worst thing that has ever happened to you (or more properly, to your software) while programming in C++? In which ways can it be more dangerous than say plain C, for example?
The virtual destructor requirement is easy for new comers to miss (although I think most compilers are smart enough to point this one out).
delete [] array;
can sometimes become
delete array;
in the hands of someone who doesn't know. Tracking that bug down can suck horribly, and doesn't happen when you're doing malloc and free.
buffer overflows have to be the most dangerous things in both c and c++. This is also the reason that Microsoft announced that they have added memcpy() to their list of banned functions
multiple inheritance is another
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With