The float returned will only exist on that line so assigning to it doesn't make sense. If it was a reference that was returned it makes more sense and you wouldn't have that error message. The question is, what are you trying to do?
machine m_short(machine mach[], int m)
{
int i;
float temp;
bool swapped=false;
do {
for(i=1;i<m;i++)
{
if (mach[i-1].time_ol(m)>mach[i].time_ol(m)) {
temp=mach[i-1].time_ol(m);
mach[i-1].time_ol(m)=mach[i].time_ol(m);
mach[i.].time_ol(m)=temp;
swapped true;
}
if (mach[i-1].time_ol(m)==mach[i].time_ol(m)) {
for (i=1,i<m,i++) {
temp=mach[i-1].cost_ol(m,cost_1);
mach[i-1].cost_ol(m,cost_1)=mach[i].cost_ol(m,cost_1);
mach[i].cost_ol(m,cost_1);
swapped=true;
}
}
}
} while (!swapped) ;
return(mach[0].time_ol(m)/mach[m].cost_ol(m,cost_1));
}
i wanted to sort by time the objects mach[i],
after that i would like to sort by time the objects mach[i] if ..see above ..