C provides rectangular multi-dimensional arrays, in practice they are much less used than array of pointers
In C, a two dimensional array is really a one dimensional array, each of whose elements is an array. Hence subscripts are written as:
An array is initialized by a list of initializers in braces
If a two-dimensional array is to be passed to a function, the parameter declaration in the function must include the number of columns; the number of rows is irrelevant
C's integration of pointers, arrays and address arithmetic is one of the strengths of the language
alloc(n), returns a pointer p to n-consecutive character positions, which can be used by the caller of alloc for storing character
afree(n) releases the storage thus acquired so it can be re-used later
Storage managed by alloc and afree is a stack or last-in, first-out list
In general, a pointer can be initialized to zero or an expression involving the addresses of previously defined data of appropriate type
C guarantees that zero is never a valid address of data, so a return value of zero signal an abnormal event
Pointers and integers are not interchangeable
Zero is sole exception: the constant zero may be assigned to a pointer, and a pointer may be compared with the constant zero
The construction p+n means the address of the n-th object beyond the one p currently points to
n is scaled according to the size of the objects p points to, which is determined by the declaration of p.
The valid pointer operations are assignment of pointers of the same type, adding or subtracting a pointer and an integer, subtracting or comparing two pointers to members of the same array, and assigning or comparing to zero