Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int** matrixReadFile(const string& path, int sizeI, int sizeJ, int** matrix) {
- ifstream fin(path);
- bool isNotCorrect;
- string line;
- int correct;
- cout << "Запись матрицы..." << endl;
- std::getline(fin, line);
- std::getline(fin, line);
- for (int i = 0; i < sizeI; i++) {
- for (int j = 0; j < sizeJ; j++) {
- do {
- isNotCorrect = false;
- fin >> matrix[i][j];
- if (fin.fail()) {
- isNotCorrect = true;
- cout << "Данные введены неккоректно. Введите " << i << "," << j << " пункт матрицы с клавиатуры." << endl;
- fin.clear();
- while (fin.get() != '\n');
- matrix[i][j] = exceptionRead(i, j);
- }
- }
- } while (isNotCorrect);
- }
- }
- return matrix;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement