So I'm trying to get the file to equate the struct type (in here Patient[i].BType == 'A'). Logic behind it is if that struct in the file reads A, output something. Its giving me errors of: error: no match for 'operator==' in 'Patient[i].Person::BType == 'A'' error: no match for 'operator==' in 'Donor[i1].Person::BType == 'A''
Any idea on how to match that type of struct array with a specific character it holds?
struct Person{
string surname;
string BType;
string organ;
int age;
int year, ID;
} Patient[50], Donor[50];
Then the code in interest is:
for (i = 0; i < 5; i++){
for (i1 = 0; i1 < 5; i1++){
if ((Patient[i].BType == 'A') && (Donor[i1].BType == 'A')){
cout << Patient[i].surname << " " << Donor[i1].surname;
}
}
}