Path: utzoo!attcan!uunet!peregrine!ccicpg!cci632!rit!jeh From: jeh@cs.rit.edu (Jim Heliotis) Newsgroups: comp.lang.c++ Subject: Re: Fairly simple Multiple Inheritance Question Message-ID: <1805@cs.rit.edu> Date: 1 Aug 90 20:27:19 GMT References: <1990Jul25.121614.16958@sisd.kodak.com> Sender: news@cs.rit.edu Reply-To: jeh@cs.rit.edu Distribution: na Lines: 33 From article <1990Jul25.121614.16958@sisd.kodak.com>, by jdg@sisd.kodak.com (Jeff Gortatowsky CUST): > > class A { ....... }; > class B { ...... }; > class C : public A, public B { .... }; > class D : public A { ..... }; > class E : public C, public D { .... }; > > main () > { > E myObject(); // Construct a class E object > B *ptrToB; // Pointer to class B object > > ptrToB = &myObject; // Illegal???? TC++ say it is. > } I ran this under cfront 2.1. Note the error it gives: CC mi.C AT&T C++ Compiling System, v2.1 CC mi.C: "mi.C", line 17: error: no standard conversion of E (*)() to B * 1 error "E myObject();" is the declaration of a function; "E myObject;" would be the declaration of an object variable, initialized by a parameterless constructor (which, by the way, compiles fine)! Jim Heliotis Rochester Institute of Technology Rochester, NY 14623-0887 jeh@CS.RIT.EDU {allegra,seismo}!rochester!rit!jeh