I was trying to make a dynamic array in this form :

```
int x;
cin>>x;
int ar[x];

```

My g++ (gcc) compiler on Linux refused to create an array without a fixed size. However using the same code on windows on dev-cpp, it was complied and executed, also it allows me to create and use the dynamic array, i thought it was a compiler bug, however when i restarted and returned to g++ it compiled and executed the code although it refused to do it before I tried the code on windows, how can that be and is it dangerous?