title: No suitable conversion exists from to * exists
body: <p>I am using linked lists to manipulate a sorted list. However, in my function PutUser, I am getting an error when calling on another function to compare two users. I am not sure what to do or how to handle the error.</p>
  <p>Here is my NodeUser struct (creates nodes for the linked list):</p>
  <pre><code>struct NodeUser { 
      User user;
      NodeUser* nextOnList;
  };
  </code></pre>
  <p>I then have a function that is suppose to create a new node and put a user into the list</p>
  <pre><code>void SortedList::PutUser(User* user) {
      NodeUser* newNode; /
      NodeUser* previousPointer; 
      NodeUser* location; 
      bool moreToSearch;
  
      location = topOfList;
      previousPointer = NULL;
      moreToSearch = (location != NULL);
  
      while (moreToSearch) {
          switch (user-&gt;comparedTo(location-&gt;user)) {
          case GREATER:
              previousPointer = location;
              location = location-&gt;next;
              moreToSearch = (location != NULL);
              break;
          case LESS:
              moreToSearch = false;
              break;
          }
      }
      newNode = new NodeUser;
      newNode-&gt;user = user;
  
      if (previousPointer == NULL) {
          newNode-&gt;next = topOfList;
          topOfList = newNode;
      }
      else {
          newNode-&gt;next = location;
          previousPointer-&gt;next = newNode;
      }
      length++;
  }
  </code></pre>
  <p>I am getting the error at (specifically location is underlined in red (error)):</p>
  <pre><code>switch (user-&gt;comparedTo(location-&gt;user))
  </code></pre>
  <p>How to fix the error at the switch?</p>