I have a problem with two dimensional arrays. This is part of my code:
const int NUM_CARS = 5;
const int NUM_SPEEDS = 6;
void getData(int noiseDataP[][NUM_SPEEDS])
{
int speed;
for (int i = 0; i < NUM_CARS; i++)
{
cout << "Enter " << NUM_SPEEDS << " noise levels for car no " << i + 1 << endl;
for ( int j = 0; j < NUM_SPEEDS; j++)
{
speed = 20 * (j + 1);
cout << " At " << speed << "km/h: ";
cin >> noiseDataP[i][j];
}
}
}
When I compile it I get the following errors:
name lookup of 'i' changed for new ISO 'for' scoping
using obsolete binding at 'i'