In this program, I'm supposed to pull numerical data out of a file (which is arranged in rows and columns in the file), put it in a double array, and display the contents on the screen. Every time I try to declare a double-type array, I get a mysterious error message. Can someone tell me why? Here's my code:
#include <iostream>
#include <fstream>
using namespace std;
int main()
{
ifstream infile;
double Acme_Calc[5][5], number;
infile.open("A:\\Cs122sales.txt");
infile.get(number);
while (! infile.fail())
{
for (int rows = 0; rows < 5; rows++);
{
for(int columns = 0; columns < 5; columns++);
{
infile.get(number);
Acme_Calc[rows][columns] = number;
cout << Acme_Calc[rows][columns];
}
}
}
infile.close();
return 0;
}