From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=0.6 required=5.0 tests=BAYES_20,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,ccae02744f89b883 X-Google-Attributes: gid103376,public From: rlk@rational.com (Bob Kitzberger) Subject: Re: Help to translate from ADA 2 C/C++ Date: 1996/04/08 Message-ID: <4kbf1c$d9s@rational.rational.com>#1/1 X-Deja-AN: 146384793 references: <4ka02c$d2d@hatathli.csulb.edu> organization: Rational Software Corporation newsgroups: comp.lang.ada Date: 1996-04-08T00:00:00+00:00 List-Id: 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