Other issues while implementing the wines code

  1. int n;
    cin>>n;
    int arr[n];
    since static allocation happens at complie time how the above code allocates memory at compile time since n is not known because it shows no error when we write like this in the program?
    which versions of c++ support this type of feature?

2.what does the statement
int arr[][]={0}
mean?when i try to run the code given in the link with only one change initialising dp array using the above statement instead of using memset the answer is wrong.why so?

3.what is the concept of static storage duration in relation to the above doubt?

4.what does memset function do