i want to read the following data from the input file in a towway dimensional array
2001 25 65 89
2002 45 69 77
I wrote the following code:
void read_data()
{
int sales[2][4];
ifstream ifs;
while(!ifs.eof())
{
for(int i=0;i<2;i++)
for(int m=0;m<4;m++)
ifs>>sales[i][m];
}
cout<<sales[i][m]<<endl;
}
is there anything wrong with this code please because i does not read well . thanks