Article View: alt.comp.lang.learn.c-c++
Article #81Re: virtual operator+
From: Christopher Deli
Date: Thu, 16 May 2002 22:56
Date: Thu, 16 May 2002 22:56
31 lines
2409 bytes
2409 bytes
a B object. Thanks. "Daniel T." <notdanielt3@gte.net> skrev i meddelandet news:notdanielt3-34A906.17313116052002@news.bellatlantic.net... > "Christopher Deli" <christopher@delinfo.com> wrote: > > >Hello! > > > >I have a problem which I'd need some help with, please. > >If I have one class A which is inherited by another class B i.e. class B : > >public class A and I would like to make a virtual operator+ in both class A > >and B so I could do the following: > >A *a, *b, *c > >a = new B(...) > >b = new B(...) > >c = new B(...) > >*c = *a + *b > >So I make a pointer of type A which points on an objekt of type B. For that > >I'd need a virtual operator+ but I have no idea how to make it. Please help! > >The source code of a program which has the similar situation would be > >perfekt! Thanks! > > What is op+ supposed to return, an "A" object or a "B" object? > > -- > Improve your company's understanding of objects... > Hire me. <http://home1.gte.net/danielt3/resume.html>
Technical Details
Message-ID:
<lOWE8.38315$n4.8433716@newsc.telia.net>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!news.tele.dk!small.news.tele.dk!195.54.122.107!newsfeed1.bredband.com!bredband!news000.worldonline.se!TeliaNet!194.22.194.4.MISMATCH!masternews.telia.net.!newsc.telia.net.POSTED!not-for-mailReferences:
<5mVE8.38287$n4.8427350@newsc.telia.net> <notdanielt3-34A906.17313116052002@news.bellatlantic.net>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10d4ba,e2ff40a616ce87ab X-Google-Attributes: gid10d4ba,public X-Google-Thread: 114592,e2ff40a616ce87ab X-Google-Attributes: gid114592,public X-Google-Thread: 109fba,e2ff40a616ce87ab X-Google-Attributes: gid109fba,public X-Google-ArrivalTime: 2002-05-16 15:56:25 PST Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!news.tele.dk!small.news.tele.dk!195.54.122.107!newsfeed1.bredband.com!bredband!news000.worldonline.se!TeliaNet!194.22.194.4.MISMATCH!masternews.telia.net.!newsc.telia.net.POSTED!not-for-mail From: "Christopher Deli" <christopher@delinfo.com> Newsgroups: alt.comp.lang.learn.c-c++,att.lang.c++,comp.lang.c++ References: <5mVE8.38287$n4.8427350@newsc.telia.net> <notdanielt3-34A906.17313116052002@news.bellatlantic.net> Subject: Re: virtual operator+ Lines: 33 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2600.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 Message-ID: <lOWE8.38315$n4.8433716@newsc.telia.net> Date: Thu, 16 May 2002 22:56:17 GMT NNTP-Posting-Host: 212.181.175.122 X-Complaints-To: abuse@telia.com X-Trace: newsc.telia.net 1021589777 212.181.175.122 (Fri, 17 May 2002 00:56:17 CEST) NNTP-Posting-Date: Fri, 17 May 2002 00:56:17 CEST Organization: Telia Internet