4 ms·
Well, there's a trick to writing C++ with no crashes and no memory corruption: never allocate memory using pointers. If you store all your data in stack variabl
by clock_tower 11y ago
Well, there's a trick to writing C++ with no crashes and no memory corruption: never allocate memory using pointers. If you store all your data in stack variables and STL containers, C++ becomes a _much_ more forgiving language (especially if you also avoid templates and operator overloading).
I imagine that this poster and his team took a similar approach with C: avoiding the dangerous features, or just finding ways to factor them out.
- humanrebar 11y agoEven if you do all the things you said, you can still crash a C++ program. Iterator invalidation is very easy to do on accident, for example.