1 2 3 4 5 6 7 8 9

The differences between C and C++ only become apparent
when we think about how to provide access functions to
manipulate our complex numbers.


In C, we write functions which take the complex type as
parameters and generate complex results. This is OK,
but
...
*How do we keep these support functions together?


*How do we prevent name conflicts between our local
complex functions and other software?

*


*

How do we provide a nice syntax?
Z = add_complex (Z1, Z2)is clumsy-looking C-code.


How do we hide the capability of the internal methods?

The short answer is that in C we can't.


Name conflicts can be quite serious in large software
projects. If the language does not support C++ style
encapsulation, we are forced to use awkward variable
names and consistent prefixes...

8 March, 1998

Page {PAGE }

TAM/DS