Error: a value of type "long *" cannot be assigned to an entity of type "long"
<p>So I'm doing a Lab assignment for my C++ class, but I'm stuck on this error:</p>

<pre><code>a value of type "long *" cannot be assigned to an entity of type "long"
</code></pre>

<p>Here is the code in question:</p>

<pre><code>//function that points current_ptr to node 
//before position where new should be inserted

void sort_inserted_node(long year)
{
  long temp_year;
  history_node *temp_ptr;

  if(head_ptr-&gt;next != NULL)
  {
    current_ptr = head_ptr;
    temp_ptr = current_ptr-&gt;next;
    temp_year = temp_ptr-&gt;hist_year;
    while((current_ptr-&gt;next !=NULL) &amp;&amp; (year &lt; temp_year))
    {
      current_ptr = temp_ptr;
      temp_ptr = current_ptr-&gt;next;
      temp_year = temp_ptr-&gt;hist_year;
    }
  }
  else
  {
     current_ptr = head_ptr;
  }
}
</code></pre>

<p>I don't know why it is giving me this error. Could someone please explain the problem, and give me some pointers as to how I might fix this? </p>

<p><a href="http://aspiratia.com/images/Untitled.png" rel="nofollow">Here is a screenshot of the code and the error messages in my IDE</a></p>
