I want to read a matrix from a file and use it in my program. but when I output the results, it shows that it is not reading correctly.
Here is the code:

```
#define I 5 
#define J 5 
#define P 2 

int i,j,k;  //for loops

int main ()
{
    ifstream inFile;
    ofstream outFile;
    double C[I][J];

    inFile.open("C.txt", ios::in);
    if (! inFile) {
        cerr << "unable to open file C.txt for reading" << endl;
        return 1;
    }

    for(i=0; i<I; i++)
        for(j=0; j<J; j++)
            inFile >> C[i][j];

    outFile.open("results.txt");
    outFile<< "C" <<endl;
    for(i=0;i<I;i++)
    {
        for(j=0;j<J;j++)
            outFile<< C[i][j];
        outFile<< endl;
    }

    inFile.close();
    outFile.close();

    return 0;
}

```

C is a matrix of integer values 2 3 5... but what I get is 

> 
> 316-9.25596e+061-9.25596e+061-9.25596e+061-9.25596e+061
>  -9.25596e+061-9.25596e+061-9.25596e+061-9.25596e+061-9.25596e+061 -9.25596e+061-9.25596e+061-9.25596e+061-9.25596e+061-9.25596e+061 -9.25596e+061-9.25596e+061-9.25596e+061-9.25596e+061-9.25596e+061 -9.25596e+061-9.25596e+061-9.25596e+061-9.25596e+061-9.25596e+061
> 
> 
>