title: What's the reason of the linked list has a zero beginning of the beginning? C++
body: <pre><code>#include &lt;iostream&gt;    
  
  using namespace std;
  
  struct Node {
      int data;
      Node* next;
  };
  
  void add(struct Node *head, int n) {
      Node *newNode = new Node;
      newNode-&gt;data = n;
      newNode-&gt;next = NULL;
      Node *cur = head;
      while(cur) {
          if(cur-&gt;next == NULL) {
              cur-&gt;next = newNode;
              return;
          }
  
          cur = cur-&gt;next;
      }
  }
  
  void display(struct Node *head) {
      Node *list = head;
      while(list) {
          cout &lt;&lt; list-&gt;data &lt;&lt; " ";
          list = list-&gt;next;
      }
      cout &lt;&lt; endl;
      cout &lt;&lt; endl;
  }
  
  int main()
  {
      struct Node *newHead;
      struct Node *head = new Node;
      int ar[]={2,5,46,7,55};
      for(int i=0; i&lt;5;i++){
          add(head,ar[i]);
      }
      display(head);
  }
  </code></pre>
  
  <p>OUTPUT:</p>
  
  <blockquote>
    <p>0 2 5 46 7 55</p>
  </blockquote>
  
  <p>What's the reason of the linked list has a zero of the beginning? 
  And how can I fix it? I do not want to print zero.</p>
  
  <p>If you see some mistakes in my code, please tell me. I am new at coding.</p>