title: Can't fill in list with numbers
body: <p>I've written a program to make a list and put numbers into it, but after I put two numbers into it I get an error. Can anyone tell me why I'm getting that error? And is there are easy way to work with lists?</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  
  typedef struct element element;
  struct element
  {
      int val;
      struct element *suiv;
  };
  
  typedef element* liste;
  
  element* creer_cellule()
  {
      element* nouv;
      nouv=(element*)malloc(sizeof(element));
      if (nouv==NULL)
      {
          printf("erreur memoire pleine");
          exit(0);
      }
      else
      {
          nouv-&gt;suiv=NULL;
          printf("donner un entier");
          scanf("%d",&amp;nouv-&gt;val);
      }
  }
  
  void inserer_queue(element* t)
  {
      element*nouv,*p;
      nouv=creer_cellule();
      p=t;
      while(p-&gt;suiv!=NULL)
      {
          p=p-&gt;suiv;
      }
      p-&gt;suiv=nouv;
  }
  
  void affiche_liste (element*t)
  {
      element* p;
      p=t;
      while(p!=NULL)
          printf("%d",p-&gt;val);
  }
  
  void main(){
      element* tete=NULL;
      int i,n;
      printf("donner le nombre d'etudiants");
      scanf("%d",&amp;n);
      tete=creer_cellule();
      for(i=1;i&lt;n;i++){
          inserer_queue(tete);
          affiche_liste(tete);
      }
  }
  </code></pre>