Advertisement
Guest User

Untitled

a guest
Aug 30th, 2014
250
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. class Node: public NodeBase {
  2. T data;
  3. NodeBase *parent;
  4. public:
  5. Node(T);
  6. void setData(T);
  7. T * getData(void);
  8. void setParent(NodeBase * const);
  9. NodeBase * getParent(void);
  10. };
  11.  
  12. class NodeBase {
  13. };
  14.  
  15. Node<char> n1 = Node('A');
  16. Node<int> n2 = Node(63);
  17. n1.setParent(&n2);
  18.  
  19. NodeBase *pNode = n1.getParent();
  20. pNode->getData(); // Error: BaseNode has no member 'getData()'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement