by rewqfdsa · 10y ago · 0 comments
If you don't want to use this style of programming, for whatever reason, check out sys/queue.h. It's already on your system, if you're using some kind of Unix.
If you don't have full control over when memory is being allocated/reallocated, your system is now non-deterministic.
With pure C, you can know exactly when those few extra instructions for resizing your dynamic array are going to happen.
In any case, while C++ has lots of defects, “loss of control relative to what C gives you” isn't one of them.