Actually, the task looked like sth like this:
Create a multiple inheritance to derive the below algebraic hierarchical computation: -given a vertical shaped networks over 3 node. Derive the lowest module single object and process the vertical hierarchical data.
I'm starting to think I may have perceived the task incorrectly; maybe, what it requires is not a multiple inheritance indeed.
I am so confused and do not know what...
User Profile
Collapse
-
Last edited by Niheel; May 9 '11, 07:36 PM. -
Code:#include<iostream.h> #include<iomanip.h> #include<assert.h> class treenode{ friend class tree; public: treenode(const int &d):leftptr(0),data(d),rightptr(0){cout<<"base"<<endl;} int getdate() const{return data;} private: treenode *leftptr; int data; treenode *rightptr; }; //////////////////////////////////////////////////////////1
Leave a comment:
-
Is it possible to derive a tree from two different parent classes in C++?
Hi guys, I’ve been given a task in which my teachers even cannot help me through! I wonder how can I derive a tree from two different parent classes in C++; i.e. which parameters should be from the first and which from the second? I tried putting the left and right pointers in the second and the data in the first, but due to the difference in types, I am not able to use them?
Thanks by the way,
No activity results to display
Show More
Leave a comment: