how to take matrix input from file in c++ code example
Example: c++ read matttrix from text file
ifstream f("matrix.txt");
f >> m >> n;
if ((m != 4) || (n != 3))
{
cout << "Matrix not 4 by 3!n";
return 1;
}
for (int i = 0; i < m; i++)
for (int j = 0; j < m; j++)
f >> A[i][j];