
Go backward to Representation
Go up to Arrays
Go forward to Allocation
Definition
Array<T> a
Array<T> a(n)
int n
Specification: Defines an array handle a.
- In the first form, a is not yet bound to any array.
- In the second form, a is bound to a new array with n slots.
The contents of the slots are undefined.
Constraints: It is illegal to define a with n < 0.
Note: The second form is equivalent to
Array<T> a
a.alloc
(n)
which is in turn equivalent to but more efficient than
Array<T> a
a =
Array<T>::Alloc
(n)
Wolfgang.Schreiner@risc.uni-linz.ac.at
Id: main.tex,v 1.10 1996/04/04 11:45:47 schreine Exp