title: How can I delete the Error when creating pointers on C++? I this case I have to use raw pointers
body: <p>I'm trying to make a linked list with a pointer to a template class called Node:</p>
  <pre><code>template &lt;typename T&gt;
  class llnode
  
  {
  public:
      T key;
      llnode&lt;T&gt; *prev, *next;
  
      llnode()
      {
  
      };
  
      llnode(const T &amp;k, llnode&lt;T&gt; *w = NULL, llnode&lt;T&gt; *y = NULL) : key(k), prev(w), next(y){};
  
      ~llnode()
      {
          delete this;
      }
  };
  </code></pre>
  <p>But, when I run the program this code in the <code>main</code> function</p>
  <pre><code>llnode&lt;int&gt; *node;
  node-&gt;key = 6;
  llnode&lt;int&gt; *node1;
  node-&gt;key = 2;
  </code></pre>
  <p>I get the error message:</p>
  <pre><code>403 cygwin_exception::open_stackdumpfile: Dumping stack trace to &quot;NAME OF MY EXE&quot;.exe.stackdump
  </code></pre>
  <p>How can I create more nodes without getting the error?
  It happens when I have 2 nodes created, but when I have 1 it does it right.</p>