title: List structure - checking for sublist
body: <p>As i'm new to C programming, I'll be posting entire (not long code). Tasks i've been given are to implement insertion of an element inside list, while list stays in order, to print it, and then to check if one list is sublist of another. 
  Although my <em>insert</em> and <em>print</em> methods work, I get a bunch of warnings:
  <em>warning: passing argument 1 of 'Insert' from incompatible pointer type [enabled by default]|</em>. How can fix my code in order to remove these warnings? </p>
  
  <p>Also, logically, I think that Contains method is OK, so why doesn't it work? It does work when comparing two lists of single element.  </p>
  
  <p>Code looks like this:</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include "stdlib.h"
  
  typedef struct Book{
      int id;
      char name[50];
      float earnings;
  } Book;
  
  struct Node{
      struct Book data;
      struct Node* next;
  };
  
  void Insert(struct Node** list, struct Book k)
  {
      struct Node* previous;
      struct Node* current;
      struct Node* newNode;
  
      newNode=(struct Node*)malloc(sizeof(struct Node));
  
      newNode-&gt;data = k;
      newNode-&gt;next = NULL;
  
      if(*list==NULL)
      {
          *list = newNode;
      }
      else
      {
          current = *list;
          previous = NULL;
  
          while((current!=NULL) &amp;&amp; current-&gt;data.earnings&lt;k.earnings){
              previous = current;
              current = current-&gt;next;
          }
          if(current == NULL)
              previous-&gt;next = newNode;
          else
          {
              if(previous == NULL)
              {
                  newNode-&gt;next = (*list);
                  *list = newNode;
              }
              else
              {
                  previous-&gt;next = newNode;
                  newNode-&gt;next = current;
              }
          }
      }
  }
  
  void Print(struct Node** list){
      if((*list)==NULL){
         printf("List is empty.");
         return;
      }
      printf("\nList looks like this:\n");
      while(*list!=NULL){
          printf("%d\n",(*list)-&gt;data.id);
          printf("%s\n",(*list)-&gt;data.name);
          printf("%f\n",(*list)-&gt;data.earnings);
          *list = (*list)-&gt;next;
      }
      printf("\n");
  }
  
  
  int Contains(struct Node** l1, struct Node** l2){
      while((*l2)!=NULL)
      {
          while((*l1)!=NULL)
          {
              if((*l1)-&gt;data.id==(*l2)-&gt;data.id &amp;&amp; (*l1)-&gt;data.name==(*l2)-&gt;data.name)
                  return 1;
  
              *l1 = (*l1)-&gt;next;
          }
          *l2 = (*l2)-&gt;next;
      }
      return 0;
  }
  
  int main()
  {
      struct Book book = {5,"War and peace",100.50};
      struct Node** n = NULL;
      struct Book book1 = {6,"Anna Karenina",20.5};
      struct Book book2 = {7,"Master and Margarita", 150.60};
      struct Node** n1 = NULL;
      struct Book book3 = {6,"Anna Karenina",20.5};
  
  
      Insert(&amp;n,book);
      Insert(&amp;n,book1);
      Insert(&amp;n,book2);
      Print(&amp;n);
      Insert(&amp;n1,book3);
  
      printf("\nDoes list2 contains list1? YES - 1, NO - 0 : %d",Contains(&amp;n1,&amp;n));
  
      return 0;
  }
  </code></pre>