Comment
Comment by nuclx
In common user-space non-realtime environments only use arrays, if you have known bounds for the amount of elements. If an arbitrary number of elements is needed, you need dynamic memory management anyways, so use linked lists. If your requirements prohibit malloc (at all or after initialization), you need to work with the available RAM as it suits your needs. Use fixed upper bounds, but check for full arrays and report errors, if array bounds are exceeded. This can be a bit of an art, especially when it comes to deciding what data to keep on the stack, in global arrays or on the heap as well as choosing approriate array sizes. Profile the RAM you need against what is available to you and optimize array sizes to make best use of the available RAM.