We create Dynamic Array when we don't know the exact size of input at compile time, right? But can't we solve this problem without using Dynamic arrays? For Example:
cout<<"Enter Size of Array";
cin>>x;
int arr[x];
By using above piece of code we can create an int Array and the Size of Array depends upon User Input (i.e x). If this Code Solves our problem then what is the need of Dynamic Array?
I am new in programming, So try to explain it Simply. Thanks.