View Single Post
Old May 25th, 2006, 3:59 PM   #1
Laterix
Newbie
 
Join Date: May 2006
Posts: 3
Rep Power: 0 Laterix is on a distinguished road
About pure virtual function calls

Hi all, I'm new here.

My question is about dynamic binding and polymorphism of the C++. I'm working on my first C++ project. Before I used Java.

So, I have abstract base class that implements some of the functions, but not all. So there are also pure virtual functions in my abstract base class. Now I have function foo() which is implemented in abstract class and function goo() which is pure virtual function.

I get linker error with code like this:
Base::foo()
{
    this->goo();
}
So I'm trying to call undefined function goo, which is defnied in subclasses. Is this just not possible in C++ or am I doing something wrong here? I believe that this is possible in Java.
Laterix is offline   Reply With Quote