title: Linked List trying to swap two linked list assignment error
body: <pre><code>Contact * l = head;
  Contact * t;
  Contact * s;
  int temp;
  int temp2;
  int temp3;
  int x;
  int checkfield=0;
  t=l;
  while(t!=NULL)
  {
      s=t-&gt;GetNext();
      while(s!=NULL)
      {
          enum Field {ID, NAME, CITY, STATE, ZIP};
          if(field==1)
          {
              if(t-&gt;GetID()&gt;s-&gt;GetID())
                  checkfield=1;
                  temp=t-&gt;GetID();
                  temp2= s-&gt;GetID();
                  s-&gt;GetID()=temp; 
  </code></pre>
  <hr />
  <p>int Contact::GetID(){ return id; } //This is the GetID Function</p>
  <hr />
  <p>For some reason, for the <code>s-&gt;GetID()=temp</code> it says &quot;the expression is not assignable&quot; Why is this the case and how can I solve this?
  }</p>