I keep getting an error "cannot convert parameter 1 from 'char (*)[15]' to 'Student_Type *" in the swap call.
gradclass is a struct and Student_Type is the name of the struct. Im trying to sort names with this. Anyone know how to fix this?
void SortNames(Student_Type* gradclass, int i)
{
int smallest;
for(int firstUnsorted = 0; firstUnsorted < 12 -1; firstUnsorted++)
{
smallest = firstUnsorted;
for(int current = smallest + 1; current < 12; current++)
{
if(*gradclass[current].lastname < *gradclass[smallest].lastname)
smallest=current;
}
Swap(&gradclass[firstUnsorted].lastname, &gradclass[smallest].lastname);
}
}
void Swap(Student_Type* element1, Student_Type* element2)
{
Student_Type temp=*element1;
*element1=*element2;
*element2=temp;
}