Any insight will be most helpful.
Basically, I'm trying to sort an array of structure type Employee by ssn which is an array of type char. My reasoning is to compare the strings and if string 1 is greater then string 2, swap Employee[1] with Employee[2].
Does this make sense?
Here's the part of the code and error messages I'm getting:
__________________________________________________
void ssnSort (Employee[], int); //Sort by ssn
ssnSort (Staff, numpeople);
void ssnSort (Employee Staff, int num) {
void swap (Employee[], Employee[]);
int value = 0;
for (int pass=0; pass!=num; pass++)
for (int i=0; i!=num; i++) {
/*175*/ value = strcmp (char Staff.ssn[i], char Staff.ssn[i+1]);
if (value > 0) {
/*177*/ swap ( Staff[i], Staff[i+1] );
}
}
}
void swap (Employee *Employee1, Employee *Employee2) {
Employee hold = *Employee1;
*Employee1 = *Employee2;
*Employee2 = hold;
}
_______________________________________
"hwk6.cc", line 175: Error: Could not find a match for std::strcmp(char, char).
"hwk6.cc", line 177: Error: The operation "Employee[int]" is illegal.
"hwk6.cc", line 177: Error: The operation "Employee[int]" is illegal.
3 Error(s) detected.