Jump to content
  • Advertisement
Sign in to follow this  
derek7

this way I can call virtual function?

This topic is 4894 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

class A { public: virtual pure() = 0; create () ; } a::create(){ ... pure(); ...} A a; a.create()?? this way what does the pure() do?

Share this post


Link to post
Share on other sites
Advertisement
You have to write the implementation of Pure in a derive class for it to work.

ace

Share this post


Link to post
Share on other sites
You mean I can instance it?
or I can instance it and just use the function it not include pure virtual function?

class A
{
public:
virtual pure() = 0;
create () ;
run () ;
}

A::create(){ ... pure(); ...}
A::run() {pintf ("test");}

A a;

So I can't call create(); I can call run()?

Share this post


Link to post
Share on other sites
You can't call either. The class is incomplete & thus you won't be able to create any instances of it (also you didn't specify types for create() or run())

Erm does that answer the question?

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!