title: no match for ‘operator*’ (operand type is ‘node’) in C
body: <p>I am trying to implement linked list in c. I am passing head struct node to all of the function using double linked list. I am taking the help of
  <a href="https://stackoverflow.com/questions/766893/how-do-i-modify-a-pointer-that-has-been-passed-into-a-function-in-c">How do I modify a pointer that has been passed into a function in C?</a>. I don't know where I am wrong. </p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  
  void choice(struct node **);
  void Insert(struct node **);
  void Display(struct node **);
  void Search();
  
  
  struct node 
  {
      int value;
      struct node *link;
  };
  
  
  
  int main(int argc, char const *argv[])
  {
  
  
      struct node *head = NULL;
  
      choice(&amp;head);
  
      return 0;
  }
  
  
  void choice(struct node **head)
  {
      int choice;
      while(1)
      {
          printf("Enter your choice: \n");
  
          printf(" 1. Insert a list\n 2. Display the list\n 3. Search the list\n : ");
  
          scanf("%d",&amp;choice);
  
          switch(choice)
          {
              case 1: Insert(head);break;
              case 2: Display(head);break;
              case 3: Search();break;
          }
      }
  
  }
  
  void Insert(struct node *head)
  {
      int new_value;
      printf("Enter the value to be inserted: \n");
      scanf("%d",&amp;new_value);
      if ( **head == NULL )
      {
          printf("head is NULL\n");
          **head = (struct node *)malloc(sizeof(struct node));
          (**head) -&gt; value = new_value;
          **head -&gt; link = NULL;
  
      }
  
      else
      {
          struct node *new_node = (struct node *)malloc(sizeof(struct node));
  
          new_node -&gt; value = new_value;
  
          new_node -&gt; link = NULL;
  
          struct node *temp = *head;
  
          while ( temp -&gt; link != NULL )
          {
              temp = temp -&gt; link;
          }
  
          temp -&gt; link = new_node;
      }
      Display(head);
  
  
  }
  
  void Display(struct node *head)
  {
      struct node *temp = *head;
  
      while ( temp -&gt; link != NULL )
      {
          printf("The value is: %d\n", temp -&gt; value );
      }
  
  }
  
  void Search()
  {
  
  }
  </code></pre>
  
  <p>I am getting errors like:</p>
  
  <blockquote>
  <pre><code>  /home/shahjahan/Desktop/interview/datastructure/ll.c: In function ‘void Insert(node*)’:
  /home/shahjahan/Desktop/interview/datastructure/ll.c:56:7: error: no match for ‘operator*’ (operand type is ‘node’)
    if ( **head == NULL )
         ^
  /home/shahjahan/Desktop/interview/datastructure/ll.c:59:3: error: no match for ‘operator*’ (operand type is ‘node’)
     **head = (struct node *)malloc(sizeof(struct node));
     ^
  /home/shahjahan/Desktop/interview/datastructure/ll.c:60:4: error: no match for ‘operator*’ (operand type is ‘node’)
     (**head) -&gt; value = new_value;
      ^
  /home/shahjahan/Desktop/interview/datastructure/ll.c:61:3: error: no match for ‘operator*’ (operand type is ‘node’)
     **head -&gt; link = NULL;
     ^
  /home/shahjahan/Desktop/interview/datastructure/ll.c:73:24: error: cannot convert ‘node’ to ‘node*’ in initialization
     struct node *temp = *head;
                          ^
  /home/shahjahan/Desktop/interview/datastructure/ll.c:82:14: error: cannot convert ‘node*’ to ‘node**’ for argument ‘1’ to ‘void Display(node**)’
    Display(head);
                ^
  /home/shahjahan/Desktop/interview/datastructure/ll.c: In function ‘void Display(node*)’:
  /home/shahjahan/Desktop/interview/datastructure/ll.c:89:23: error: cannot convert ‘node’ to ‘node*’ in initialization
    struct node *temp = *head;
                         ^
  [Finished in 0.0s with exit code 1]
  </code></pre>
  </blockquote>