title: Pointers in c: Function which deletes every second element of linked list
body: <p>I want to write a function which gets a pointer to a header of a linked list and deletes from the list every second member of it. The List is a linked elements of type <em>element</em>:</p>
  
  <pre><code>typedef struct element{
      int num;
      struct element* next;
  }element;
  </code></pre>
  
  <p>I'm new to all these pointers arithmetic so I'm not sure I write it correctly:</p>
  
  <pre><code> void deletdscnds(element* head) {
      element* curr;
      head=head-&gt;next; //Skipping the dummy head//
  
      while (head!=NULL) {
          if (head-&gt;next==NULL) 
              return;
  
              else {
                  curr=head;
                  head=head-&gt;next-&gt;next; //worst case I'll reach NULL and not a next of a null//
                  curr-&gt;next=head;
              }
          }
      }
  </code></pre>
  
  <p>I kept changing it since I kept finding errors. Can you please point out any possible errors?</p>