next up previous contents index
Next: The form of the Up: A note on C++ Previous: Mathematical operators.   Contents   Index

Dynamically sized arrays.

Most programming languages do not allow the programmer to specify variable-sized arrays ``on the fly.'' In FORTRAN or Pascal we would usually have to set a maximum length for each array, and hope that we would not need to exceed that length. In addition to the problem of ensuring that we did not exceed the length, this is also wasteful in terms of space.

In the latest version of the C++ standard, a library called the Standard Template Library is included. One of the most useful parts of this library is the vector$<>$ template, which gets rid of the ``bookkeeping'' involved in the previous array manipulations. In most of the routines I use a vector of doubles instead of an array, because this reduces the numbers of parameters needed to pass.


next up previous contents index
Next: The form of the Up: A note on C++ Previous: Mathematical operators.   Contents   Index
Bernt Arne Odegaard
1999-09-09