Guest User

Untitled

a guest
Oct 21st, 2018
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. 4
  2. 4
  3. 1 2 3 4
  4. 1 2 3 4
  5. 1 2 3 4
  6. 1 2 3 4
  7.  
  8. Matrix array1("file1.txt");
  9. cout << (array1);
  10.  
  11. class Matrix {
  12. public:
  13.  
  14. Matrix(string filename);
  15.  
  16. Matrix();
  17.  
  18. Matrix(int x, int y);
  19.  
  20. private:
  21. int x;
  22. int y;
  23.  
  24. };
  25.  
  26. Matrix:: Matrix(string filename){
  27. int array[99][99]; //assume thats the maximum size
  28. ifstream fin;
  29. fin.open(filename);
  30. if (fin.is_open()) {
  31. fin >> Matrix.x;
  32. fin >> Matrix.y;
  33. // how should I store the 2D array.
  34. printMatrix(x,y);
  35. }
Add Comment
Please, Sign In to add comment