Hi i am new to learning programming and C++, i just want to ask why we create dynamic arrays like this.
int size;
cin >> size;
int* arr = new int[size];
why can't i do :
int size;
cin >> size;
int arr[size];
The method without the new keyword gives me the same result, but my Teacher and Others use the method with the new keyword.