title: Can't return Node pointer
body: <p>I am writing a C++ linked list class.  I have implemented and tested insert and print.  However, I can't seem to return a Node pointer for delete.  I get these errors when I try delete:</p>
  
  <pre><code>    Node.h:11: error: expected unqualified-id before "delete"
      Node.h:11: error: abstract declarator `Node*' used as declaration
      Node.h:11: error: expected `;' before "delete"
  
      Node.cpp:21: error: expected unqualified-id before "delete"
      Node.cpp:21: error: expected init-declarator before "delete"
      Node.cpp:21: error: expected `,' or `;' before "delete"
  
      make.exe: *** [Node.o] Error 1
  
      Execution terminated
  </code></pre>
  
  <p>Here's my code: </p>
  
  <p>Node.h</p>
  
  <pre><code>    #ifndef Node_H
      #define Node_H
  
  
      class Node{
            int data;
            Node* next;
  
      public:
             Node(int data);       
             void insert(int d);
             Node* delete(int d);
             void printOut(void);
      };
  
      #endif
  </code></pre>
  
  <p>Node.cpp</p>
  
  <pre><code>    #include &lt;stdio.h&gt;
      #include "Node.h"
  
      Node::Node(int d){
            data = d;
            next = NULL;
            }
  
      void Node::insert(int d){
  
            Node* n = this;
            Node* current = new Node(d);
  
            while(n-&gt;next != NULL){
                    n = n-&gt;next;                   
                    }
  
            n-&gt;next = current;
            }
  
      Node* Node::delete(int d){
  
            Node* head = this;
            Node* n = this;
  
            if (n-&gt;data = null){
               return n;
               }
  
            if (n-&gt;data == d){
               return n-&gt;next;
               }
  
            while(n-&gt;next != NULL){
  
            if (n-&gt;next-&gt;data == d){
               n-&gt;next = n-&gt;next-&gt;next;
               return head;
               }
  
            n = n-&gt;next;
  
            }
  
          return head;
  
          }
  
      void Node::printOut(void){
  
           Node* n = this;
  
           while(n-&gt;next != NULL){
                        printf("%d -&gt;", n-&gt;data);
                         n = n-&gt;next;                   
                         }
  
           printf("%d \n", n-&gt;data);
  
           }
  </code></pre>
  
  <p>main:</p>
  
  <pre><code>    #include &lt;iostream&gt;
      #include &lt;stdio.h&gt;
      #include &lt;cstdlib&gt;
  
      #include "Node.h"
      using namespace std;
  
      int main (void){
          int i = 0;
  
          Node* root = new Node(111);
          Node* result;
  
          for (i = 0; i &lt; 9; i++){
              root-&gt;insert(i);
              } 
  
          root-&gt;printOut();
  
          result = root-&gt;delete(5);
  
          result-&gt;printOut();
  
          printf("Hello j \n");
  
          getchar();
          delete[] root; 
          return 0;   
      }
  </code></pre>