Anyone know why Visual Studio 2019 is the only compiler to giving me error - Expression must have a constant value? Line 11(E0028). In other compilers everything is fine, the problem is only with VS
#include <iostream>
#include <math.h>
using namespace std;
const double pi = acos(-1);
signed main() {
int n;
cin >> n;
double mass[n];
for (int i = 0; i < n; i++) cin >> mass[i];
int c = 0;
for (int i = 1; i <= n; i++) {
mass[i - 1] /= i;
if (mass[i] < 0) c++;
}
cout << c << endl;
}