title: How to cast an variable with type abstract class to its subclass?
body: <p>I'm writing an interface for a method.</p>
  
  <pre><code>void method(Node* node);
  </code></pre>
  
  <p>The interface has the code</p>
  
  <pre><code>class Node {
   public:
       virtual void init(Node* a) = 0;
  };
  </code></pre>
  
  <p>The sub class has the code</p>
  
  <pre><code>class CNode: public Node {
   public:
       void init(Node* a);
       void init(CNode* a);
  }
  </code></pre>
  
  <p>In the code <code>CNode::init(Node* a)</code>, the function will try to convert <code>a</code> into <code>CNode</code>, then call <code>CNode::init(CNode* a)</code>.  </p>
  
  <p>I'm trying to implement it with </p>
  
  <pre><code>void CNode::init(Node *a) {
      CNode b = dynamic_cast&lt;CNode *&gt;(*a);
  }
  </code></pre>
  
  <p>However, clang reported this error</p>
  
  <blockquote>
    <p>'Node' is not a pointer</p>
  </blockquote>
  
  <p>How can I solve this problem?</p>