Chapter 10. Dynamic Arrays
An array is a homogeneous sequence of values in which the elements in the sequence are associated one-to-one with indices in a contiguous range. Arrays in some form appear as built-in data types in virtually all programming languages. In some languages, like C, all array indices have the same lower bounds, and in other languages, like Modula-3, each array can have its own bounds. In C, all arrays have indices that start at zero.
Array sizes are specified at either compile time or runtime. The sizes of static arrays are known at compile time. In C, for example, declared arrays must have sizes known at compile time; that is, in the declaration int a[n]
, n
must be constant expression. A static array may be allocated at runtime; ...
Get C Interfaces and Implementations: Techniques for Creating Reusable Software now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.