Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

 
 
Thread Tools Display Modes
Prev Previous Post in Thread   Next Post in Thread Next
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
 

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 5:15 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC