// Gaus.cpp: определяет точку входа для консольного приложения. // #include "stdafx.h" #include <iostream> #include <fstream> using namespace std; class matrix { private: int n; double **A; double *b; inline void ifend(); void filling(); public: matrix() :n(0), A(NULL), b(NULL) {} matrix(int x) :n(x) { b = new double[n]; A = new double *[n]; for (int i(0); i < n; i++) { *A = new double[n]; } } void constructor(); void gauss(); void show(); }; inline void matrix::ifend() //Проверка на заполнение размера матрицы { if (n == 0) { cout << "The size of matrix not found"; system("pause"); exit(0); } } void matrix::constructor() //Создание системы уравнений { matrix::ifend(); matrix::filling(); } void matrix::filling() //Заполнение расширенного массива { matrix::ifend(); for (int i(0); i < n; i++) { system("pause"); for (int j(0); j < n; j++) { cout << "a" << i + 1 << j + 1 << " = "; system("pause"); cin >> A[i][j]; system("pause"); } cout << "b" << i << " = "; cin >> b[i]; } } void matrix::show() { matrix::ifend(); for (int i(0); i < n; i++) { for (int j(0); j < n; j++) { cout << A[i][j] << " * x" << j + 1; if (j == n - 1) cout << " = " << b[i]; else cout << " + "; } cout << endl; } } int main() { matrix obj1(3); obj1.constructor(); system("pause"); return 0; } It turns out an error when filling in A [2] [1] i. in the second line of the array. I somehow incorrectly allocate memory for a two-dimensional array? The first line is filled with norms.