Hello,

I am trying to do a comparison between a variable passed into a function and a pointer. The function is within a class that I set up called SortedType:

class SortedType
{
public:
SortedType(); // default constructor
SortedType(int); // regular constructor
void MakeEmpty(); // set list to empty
bool IsEmpty(); // test for an empty list (true if empty)
bool IsFull(); // test for a full list (true if full)
bool RetrieveItem (student&); // retrieve an item matching the key field
bool InsertItem(student); // add item to the list in order by key field
bool DeleteItem (student); // delete an item matching the key field
void ResetList(); // set next pointer to beginning of list
bool GetNextItem(student&); // get next sequential item
private:
int length; // number of items in list plus subscript of next add
int currentPos; // item to retrieve on Get Next Item function
int maxItems; // from user constructor for size of array
int location; // location of student* info
bool moreToSearch; // returns true if greater or false if less
student* info; // pointer to the student array
};

the function is called InsertItem:

bool SortedType::InsertItem(student item)
{
if (length >= maxItems)
return false;

location = 0;
moreToSearch = (location < length);

while (moreToSearch)
{
if (item < info[location])
moreToSearch = false;
else
{
location++;
moreToSearch = (location < length);
}
}

for (int index = length; index > location; index--)
info[index] = info[index - 1];

info[location] = item;
length++;
return true;
}

Basically, it does not like this statement:
if (item < info[location]) and gives me this error message: "no match for 'student& < student&'".

What is wrong with this statement?

Thank you!

Ron