c++ read matttrix from text file

C++
	
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];
Source

Also in C++: