there is a function in it, I allocate memory for array x, perform calculations, then return
double* kramer(double** mat, double* y, int size) { double d = det(mat, size); double* x = new double[size]; for (int i = 0; i < size; i++) x[i] = det(get_mat(mat, y, i, size), size) / d; return x; } then in the main program I call the function
double* p_x = kramer(m, y, s); and delete p_x
delete[]p_x; Question: will my memory be freed from under array x, which I allocated in the function?
get_mat ()also allocates memory, which is not released ... - Fat-Zer