Hi everyone,
I am having trouble with this MAX function. When I set the value to 300, I receive an error asking me to either continue or break, does anyone have an idea why this happens? I am loading data from a .txt file that has about 250 rows filled in.
Thanks
I am having trouble with this MAX function. When I set the value to 300, I receive an error asking me to either continue or break, does anyone have an idea why this happens? I am loading data from a .txt file that has about 250 rows filled in.
Thanks
Rich (BB code):
void CityWithMostOurage(City Data[])
{
int max = (Data[0].NumOfOutages / Data[0].TotalCust);
for(int i=0; i < 300; i++)
{
if(max < (Data.NumOfOutages / Data.TotalCust))
max = (Data.NumOfOutages / Data.TotalCust);
}
cout << "The city with the most percetnage of outages is: " << Data[max].Name;
cout << endl;
}