Code Woks in sololearn but not in visuel studio c++
hey,i have the problem that my code works in sololearn but not in visual studios. what am I doing wrong? Thanks in advance #include <iostream> using namespace std; int main() { int n; cin >> n; //size of the array //your code goes here int nums[n]; int s = 0; for (int d = 0; d < n; d++) { cin >> s; nums[d] = s; } int max = nums[0]; for (int i = 0; i < n; i++) { if (nums[i] > max) { max = nums[i]; } } cout << max; return 0; } Severity Code Description Project File Line Suppression State Error C2131 expression did not evaluate to a constant Project1 D:\DEV\Basics\Basics\Project1\MAX(Arr).cpp 8 Severity Code Description Project File Line Suppression State Error C3863 array type 'int [n]' is not assignable Project1 D:\DEV\Basics\Basics\Project1\MAX(Arr).cpp 13