Jump to content
  • Advertisement
Sign in to follow this  

this way I can call virtual function?

This topic is 4748 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 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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!