diff --git a/pr5.cpp b/pr5.cpp index 7bc9a85..1766e7a 100644 --- a/pr5.cpp +++ b/pr5.cpp @@ -369,6 +369,25 @@ int main() { fout.close(); } + // To test wrong matrix size input + // Saving a matrix array to a file with one matrix having different dimensions + // (uncomment this for testing) + + //ofstream fout("1.txt"); + //if (fout) { + // fout << "3\n"; + // for (int i = 0; i < 2; i++) // Save the first two matrices normally + // fout << M[i] << "\n"; + // fout << "3 3 "; // Write incorrect dimensions for the third matrix + // for (int i = 0; i < 3; i++) { + // for (int j = 0; j < 3; j++) { + // fout << (rand() % 100) << " "; // Fill the incorrect matrix with random values + // } + // } + // fout.close(); + //} + + // reading a matrix array from a file Matrix* M1; ifstream fin("1.txt");