if (count > 0) {
for( i = 0; i <= MAX - 2; i++){
for( j = i + 1; j <= MAX - 1; j++){
if(stud[i].getEdad() > stud[j].getEdad()){
tempura=stud[i].getEdad();
stud[i].getEdad() = stud[j].getEdad();
stud[j].getEdad() = tempura;
}
}
}
cout <<"---------------------------------------\n";
} else {
cout <<"NONE\n";
}
What is wrong about this please help
the output for this is
0. 0
1.0
2.0
1
Expert's answer
2014-10-17T15:02:07-0400
it must be:
if(stud.getEdad()> stud[j].getEdad()) { tempura=stud.getEdad(); stud.getEdad(stud[j].getEdad()); stud[j].getEdad(tempura); } [i] [i]Becauseyou cannot assign a value of function Better if you send me all the code[i]
Comments
Leave a comment