title: How to add and print items in Linked List c
body: <p>My main is:</p>
  
  <pre><code>void main()
  {
      int flag = 1;
      LinkedList *list = NULL;
      list = makeList();
      while (flag) {
          add_last(list, makeNode(nextKey(), "uninitialized"));
          printf("please enter 0 to stop any other number to go on \n");
          scanf("%d",&amp;flag);
      }
      printKeys(list);
  }
  </code></pre>
  
  <p>I have 2 structs that define node and list:</p>
  
  <pre><code>typedef struct item{
      int data;
      char *charData;
      struct item *next;
  }item;
  
  typedef struct{
      struct item *head;
  }LinkedList;
  </code></pre>
  
  <p>I create the list by the function:</p>
  
  <pre><code>LinkedList *makeList(){
      LinkedList *head = (LinkedList*)malloc(sizeof(LinkedList));
      return head;
  }
  </code></pre>
  
  <p>and the node by the function:</p>
  
  <pre><code>item *makeNode(int key, char* data){
      item *newItem = (item*)malloc(sizeof(item));
      if (newItem != NULL) {
          newItem-&gt;data = key;
          newItem-&gt;next = NULL;
      }
      return newItem;
  }
  </code></pre>
  
  <p>Now I need to write 2 functions, 1 to add the new item in the end of the list, and the second to Print the list.</p>
  
  <p>The signing my first function is:</p>
  
  <pre><code>void add_last(LinkedList *list, item *newItem){
  
  }
  </code></pre>
  
  <p>and the second is:</p>
  
  <pre><code>void printKeys(LinkedList *list){
  
  }
  </code></pre>
  
  <p>I am novice in the world of "C" and I don't know how can I do this.
  I don't understand how to have access to the list.</p>
  
  <p>Thank...</p>