Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Virtual Functions

1 view
Skip to first unread message

Ron Blancarte

unread,
Apr 25, 2005, 5:13:57 PM4/25/05
to
Ok, so we were give this:
class funct funct
A v f() g()
B f() v g()
C f() g()

Now, if we have:
A* p = new C();

p->f() // this calls c's f()
p->g() // this calls a's g()

Let's assume that C doesn't overload f() on it's own:

class funct funct
A v f() g()
B f() v g()
C g()

does calling:
p->f()
give A's f()?

RonB

Glenn Downing

unread,
Apr 25, 2005, 8:25:10 PM4/25/05
to
It give's B's f().


On 4/25/05 4:13 PM, in article d4jmim$ss0$1...@geraldo.cc.utexas.edu, "Ron
Blancarte" <r...@removeme.blancarte.com> wrote:

--
Glenn P. Downing
The University of Texas at Austin
Department of Computer Sciences
Taylor Hall 2.124
Austin, TX 78712
(512) 471-7316
http://www.cs.utexas.edu/users/downing/

0 new messages