From: rlk@rational.com (Bob Kitzberger)
Subject: Re: Help to translate from ADA 2 C/C++
Date: 1996/04/08
Date: 1996-04-08T00:00:00+00:00 [thread overview]
Message-ID: <4kbf1c$d9s@rational.rational.com> (raw)
In-Reply-To: 4ka02c$d2d@hatathli.csulb.edu
Robert Gelb (rgelb@csulb.edu) wrote:
: I am having a hell of a time trying to translate this ADA program into
: C/C++. Maybe someone can help me.
What is C/C++ ?
: type person(sex:gender);
: type car;
: type person_name is access person;
: type car_name is access car;
Simple. Define a class for "person". Define two subclasses, one for
"male person" and one for "female person". Define a class for "car",
and as many subclasses as you see fit.
Now define a class for "car-owning person", and multiply inherit
from the car class and the person class.
By now you should have a nice deep inheritance tree, with multiple
inheritance to boot ;-) Pretty whizzy, eh? As an added feature,
it exemplifies misuse of inheritance.
Kids, don't do this at home...
--
Bob Kitzberger Rational Software Corporation rlk@rational.com
next prev parent reply other threads:[~1996-04-08 0:00 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
1996-04-08 0:00 Help to translate from ADA 2 C/C++ Robert Gelb
1996-04-08 0:00 ` Bob Kitzberger [this message]
1996-04-08 0:00 ` Robert Dewar
1996-04-13 0:00 ` Michael Feldman
1996-04-08 0:00 ` Robert Dewar
1996-04-14 0:00 ` AJW
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox