Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!apple!bionet!ames!ncar!husc6!contact!umb!rjv From: rjv@umb.umb.edu (Rafael J. Vicente) Newsgroups: comp.lang.c++ Subject: Zortech C++ problem. Keywords: derived, virtual. Message-ID: <793@umb.umb.edu> Date: 21 Jun 89 03:23:32 GMT Organization: UMASS-Boston, Boston, MA Lines: 47 To the Zortech guys (Walter Bright ?) , the following question: The following program should print a 'B' , but the output is a D. Any fixes ? I enjoy your product (1.07) but this problem kept a program from running for a while. #include class B{ public: virtual f() { return 'B';} virtual g() ; }; class D: public B{ public: D() { putchar(B::g()); } f() {return 'D'; } g() { } }; static h(B * t) { return t->B::f(); } B::g(){ return h(this); } main() { D d; puts("finished\n"); } ------------------------------------------------------------------------------ Rafael Vicente U. of Lowell (D.Sc. student/aficionado). #include " I've just found a way out of the halting problem, but wait a sec...." _____________________________________________________________________________