Insert a set of values into linked list

Hi! I've been trying to insert a set of data which are details of the employees (code, name, address and phone) into an ordered linked list.

This is the function for inserting new node:
<template <class Type>
void orderedLinkedList<Type>::insertintoList (const Type& newItem){
newNode = new nodeType <Type>; //Create the node
newNode->data = newItem; //store newItem in the node
newNode->link = NULL; //set link field of the node to NULL

if (first == NULL){ //if the list is empty
first = newNode;
last = newNode;
count++;
}
else{
current = first;
found = false;

while (current!=NULL && !found){
if (current->data >= newItem)
found = true;
else{
trailcurrent = current;
current = current->link;
}
}

if (current == first){ //if the item to be inserted is smaller than the smallest in the list
newNode->link = first;
first = newNode;
count++;
}
else{
trailcurrent->link = newNode; //if the item to be inserted is larger than the first in the list
newNode->link = current;

if (current == NULL) //if the item to be inserted is larger than the largest in the list
newNode = last;

count++;
}
}
}>

I know that for ordered lists, we need to compare the newItem with each of the items in the list to get the right position to insert it. However, when I ran the program, there's an error, because (I think) the the operands are of the type employee and the operator >= can't work on it? Can anyone help me figure it out?

Thanks!
¿so implement the >= operator for the employee class? ¿what's the issue?
Ah I see! Thank you!!
Topic archived. No new replies allowed.