|
|
|
|
|
by rewqfdsa
3743 days ago
|
|
Honestly, why? Most of the time, you want to write C++, with exceptions, and the STL. You can make this kind of programming as robust as you want against memory allocation failure. 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.