-2
void phage :: evaluate(bacteria ba[]) {
for (int i = 0; i<popsize; i++)
for (int j = 0; j<gensize; j++)
fitness += m[i] == ba[i].m[j];
}
here is an evaluate function, declared in struct. when I try to call it, there is an error "expected an expression"Fehler: "erwartet einen Ausdruck" Ich versuche, Array zu verwenden, in Funktion
for (int i = 0; i < popsize; i++)
population[i].evaluate(population[]);
entfernen '[]' von ' population [i] .evaluate (population []); ' – DimChtz
der Fehler erscheint in der Population [] –
vielen Dank! –