Untitled

 avatar
unknown
plain_text
3 years ago
414 B
1
Indexable
double** read_mat(string filename, int* size)
{
    int i;
    ifstream infile(filename);
    if (!infile)
    {
        return 0;
    }
    infile >> *size;
    string s;
    double** mat = new double* [*size];
    for (int i = 0; i < *size; i++)
    {
        for (int j = 0; j < *size; j++)
        {
            infile >> mat[i][j];
        }
    }
    infile.close();
    return mat;
}