inheritance - C++ pure virtual class question -
I am a simple B + tree implementation (very early stage) I'm trying to write. I got some fanksansa with a virtual class is. No need to say is, I am very new to these strategies and I'm running all kinds of problems.
I'm trying to create a root node within the classroom bitiarai am. Root node will be a BBranch, which must be obtained from bienoda? I'm getting errors
btree.cpp: constructor in the "BT :: :: bitiri (): bitiarasisipipi: 25: error: extract type 'bibiaranca bitiarapipi': 12: note because the following virtual functions "bibiaranca" within the net are: bitiarasipipi: 9: Note: virtual vhoida bienoda :: Dale (anti) bitiarasipipi: member function bitiri :: indesa (Int): bitiai cpp: 44: error: Unrecoverable declared this point Wait here was
The code is
namespace std use; Class BNode {public: int key [10]; Int pointer [11] ; virtual void Inns (Int number) = 0; virtual void del (Int number) = 0;}; class BBranch: public BNode {public: void in (Int number);}; class BLeaf: public BNode {public: void in (Int number);}; class BT ree {public: bitiri () {branch root;}; zero in (Int number);}; // Enter the branch node in a vacuum BBranch :: ins (int nu m) {// branches specifically to include goods}; // insert node to zero BTree :: ins (int num) {root.ins (num); }; Int main (void) {return 0; }
Thanks for any information you can give me.
What's wrong with the compiler, is very clear about this. You are a BBranch
can not be declared as a pure virtual function to the class still exists. You have ins
to define, but del
is still undefined is BBranch
(and BLeaf
) to define and you should be OK.
You can not declare instances of abstract classes, which are pure virtual function class.
In addition, you have root
Builder is declared. You for a member variable wanted to be, which means that Next need to declare a constructor, within does not.
class BTree {public: BTree () {}; BBranch route; Zero in (Int Number); };
Comments
Post a Comment