title: Delete specific element linked list
body: <p>Can you help me to understand why this function doesn't delete a specific element in the linked list? What am I doing wrong?</p>
  
  <pre><code>typedef struct str_node{
      int data;
      struct str_node *next;
  }node;
  
  ...
  node *head;
  head = malloc(sizeof(node));
  ...
  
  void delete_spec(node *a){
      int num;
      node *tmp;
  
      tmp = a;
      printf("Insert number to eliminate: ");
      scanf("%d",&amp;num);
      while(tmp!=NULL){
          if(tmp-&gt;data == num){
              tmp = tmp-&gt;next-&gt;next;
          }
          tmp = tmp-&gt;next;
      }
  }
  </code></pre>