title: Linked list add() method in C
body: <p>Where is error the following code?</p>
  
  <p><code>addNode()</code> function is not run, neither is the <code>traverse()</code> function.</p>
  
  <p>Last data is not shown.</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  
  struct isimler{
      char isim[10];
      struct isimler *next;
  };
  
  typedef struct isimler node;
  node *head;
  
  void createList(){
      int k, n;
      node *po;
      printf("Eleman Sayisi: ");  scanf("%d", &amp;n);
  
      for(k = 0; k&lt;n; k++){
          if(k == 0){
              head = (node *) malloc(sizeof(node));
              po = head;
          }else{
              po-&gt;next = (node *) malloc(sizeof(node));
              po = po-&gt;next;
          }
          printf("Isim Girin: "); scanf("%s",po-&gt;isim);
      }
      po-&gt;next = NULL;
  }
  
  void addNode(){
      node *po, *newNode;
      po = head;
  
      while(po != NULL){
          po = po-&gt;next;
      }
  
      po = (node *) malloc(sizeof(node));
      printf("Isim Girin: "); scanf("%s", po-&gt;isim);
      po-&gt;next = NULL;
  }
  
  void traverseList(){
      node *po;
      int i=0;
      po = head;
  
      while(po != NULL){
          printf("%d.\t%s\n",i,po-&gt;isim);
          po = po-&gt;next;
          i++;
      }
  }
  
  int main(){
      createList();
      traverseList();
      addNode();
      traverseList();
  
      return 1903;
  }
  </code></pre>