I think this method of defining a size of an array is wrong, but I have no idea why... Someone explain to me why this is wrong and explain a method of defining size of an array please. I am a beginner.
1 2 3 4
int n;
int array[n];
for (int i=0; i<n; i++)
cin >> a[i];