Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

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];
 
PREVIOUS NEXT
Tagged: #read #matttrix #text #file
ADD COMMENT
Topic
Name
6+7 =