Answers for "c++ read matttrix from text file"

C++
0

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];
Posted by: Guest on April-15-2020

Browse Popular Code Answers by Language