c++ - Call pure virtual function from parent class -


I am very new to c ++, but I think I understand what's going on. Parents are trying to call the pure virtual member function in class guardian class. I thought that by overriding the virtual function in the child class, it would be named instead.

What am I doing wrong?

For me in my parents.

  class parents {public: virtual zero run (=); Protected: / ** Function for starter routine and it will call * run () defined by the appropriate child class * Starter Function * for / static zero * init (zero * arg) for @arum arg argues; };  

I'm trying to do this in parent.cpp

  zero * guardian :: init (zero * arg) {run (); }  

In my child. I have this:

  Category: Public Generator {Public: // ... Virtual Zero Run (); // ...};  

And I have child.cpp in:

  zero hair :: run () {sleep (10); }  

The function in parent.cpp is init, where it fails to compile. How do I call the derivative function from the original class? All my googleing has turned notes on just calling the virtual function in the child's constructor

Any help would be appreciated.

Run () is an example member. The original: init is a stable (class-level) member in your init () implementation, (for example, parent or hair) is available, on which to call () .


Comments

Popular posts from this blog

MySql variables and php -

url rewriting - How to implement the returnurl like SO in PHP? -

Which Python client library should I use for CouchdB? -