When I delete the dynamic arr array, I get a message stating that HEAP CORRUPTION DETECTED, I have been with this problem for several days and will not get to see what's wrong here:
class Matrix { public: int row; int str; vector<TYPE*> matrix; TYPE *arr; } Problem function
void Fill(string fName) { arr = new TYPE[str]; ifstream f(fName.c_str()); if (!f.is_open()) { cout << "Enter the elements:" << endl; for (int i = 0; i < str; i++) { for (int j = 0; j < row; j++) { cin >> arr[j]; } matrix.push_back(arr); } } else { for (int i = 0; i < str; i++) { for (int j = 0; j < row; j++) { f >> arr[j]; } matrix.push_back(arr); } } f.close(); delete[] arr; }