title: Assignment from incompatible pointer type (structs, linked list)
body: <p>Creating a dictionary data structure using a linked list. </p>
  
  <pre><code>typedef struct _dictionary_entry_t
  {
      const char* key;
      const char* value;
      struct dictionary_entry_t *next;
      struct dictionary_entry_t *prev;
  
  } dictionary_entry_t;
  
  typedef struct _dictionary_t
  {   
      dictionary_entry_t *head;
      dictionary_entry_t *curr;
      int size; 
  
  } dictionary_t;
  </code></pre>
  
  <p>Working on the function to add dictionary entries to the linked list. </p>
  
  <pre><code>int dictionary_add(dictionary_t *d, const char *key, const char *value)
  {
      if (d-&gt;curr == NULL) //then list is empty
      {
          d-&gt;head = malloc(sizeof(dictionary_entry_t));
          d-&gt;head-&gt;key = key;  //set first dictionary entry key
          d-&gt;head-&gt;value = value; //set first dictionary entry value
          d-&gt;head-&gt;next = NULL; 
          //d-&gt;curr = d-&gt;head;
      }
  
      else 
      {
          d-&gt;curr = d-&gt;head;
  
          while (strcmp((d-&gt;curr-&gt;key), key) != 0 &amp;&amp; d-&gt;curr != NULL) //while keys don't match and haven't reached end of list... 
          {
              d-&gt;curr = d-&gt;curr-&gt;next; 
  
          } 
      }
  
  
      return -1;
  }
  </code></pre>
  
  <p>assigning d->curr to d->curr->next gives me the warning 'assignment from incompatible pointer type'. </p>
  
  <p>What is my mistake here? both curr and next are of the type *dictionary_entry_t</p>