
480 Chapter 19 Other Programming Languages
The additional data parameter is used to pass data to the force generator function
(in C++ this isn’t needed because the implicit
this pointer contains the generator’s
data). You can then define any number of such functions, and even hold them as
function pointers in other data structures.
I have used the C++ standard template library at a numbe r of points in the
source code to represent a variable-length array. Most other languages have native
equivalents, but C does not. To implement these structures (the list of force gener-
ators and the list of rigid bodies, for example), you can use singly or doubly