I am trying to write a programm that reads the surname introduce and gives back the info of the student (birthdate, group, etc). The compiler does not recongize the == operator, I guess it doesnt know what to compare, either the address or the value?(I would appriciate an explanation)
I read similar cases and they suggest to use bool operator. As far as I know bool operator just returns true or false(I dont see the way to use it to print the students info)
Also I was considering usind char or using strcmp (srting functions for comparing).
void find_fam ( struct st student[], int length, string & fam)
{
for(int i=0; i<length; i++)
if ( student[i]== fam[i]){
cout << "Student:\n"<< student[i].imia << student[i].otchestvo << student[i].familia <<
student[i].gruppa << student[i].grozhdenia);
}
}
Aucun commentaire:
Enregistrer un commentaire