As the title says - I have a really basic piece of code which should read two numbers, and then a 2D float array. I get no error but when I run my program, it crashes with code -1073741571 and I can't understand why.
Here's the code:
#include <iostream>
#include <iomanip>
#include <algorithm>
using namespace std;
void citireNrEcuatiiNecunoscuteSiMatriceaExtinsa(int& a, int& b, float c[][1001])
{
cout << "\nIntroduceti numarul de ecuatii: ";
cin >> a;
cout << "\nIntroduceti numarul de necunoscute: ";
cin >> b;
int i = a;
int j = b + 1;
cout << "\nIntroduceti elementele matricei extinse: ";
for (int contorLinie = 0; contorLinie < i; contorLinie++)
{
for (int contorColoana = 0; contorColoana < j; contorColoana++)
{
cin >> c[contorLinie][contorColoana];
}
}
}
int main()
{
int numarEcuatii, numarNecunoscute;
cout << setprecision(3);
float mat[1001][1001];
citireNrEcuatiiNecunoscuteSiMatriceaExtinsa(numarEcuatii, numarNecunoscute, mat);
}