this way I can call virtual function?

Started by
2 comments, last by ProPuke 18 years, 11 months ago
class A { public: virtual pure() = 0; create () ; } a::create(){ ... pure(); ...} A a; a.create()?? this way what does the pure() do?
Advertisement
You have to write the implementation of Pure in a derive class for it to work.

ace
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()?

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?
_______________________________ ________ _____ ___ __ _`By offloading cognitive load to the computer, programmers are able to design more elegant systems' - Unununium OS regarding Python

This topic is closed to new replies.

Advertisement