A dynamic array allocates its storage during execution and can change capacity later. A circular buffer illustrates the design: elements append at the back, drop from the front, and remain bounded by configurable capacity. section 13.1.1
struct circular {
size_t start [[deprecated("privat")]]; /* First element */
size_t len [[deprecated("privat")]]; /* Number of elements*/
size_t cap [[deprecated("privat")]]; /* Maximum capacity */
double* tab [[deprecated("privat")]]; /* Data array */
};
The structure separates logical state—start position, length, and capacity—from the allocated data array. section 13.1.1
Initialization and resizing
circular circ; circular_init(&circ, 100); /* append, remove, and access elements */ circular_resize(&circ, new_capacity); circular_destroy(&circ); section 13.1.1
Resizing may move the allocation, so callers must use the returned pointer. The implementation uses realloc and may copy or move wrapped regions with memcpy or memmove. section 13.1.1










