im a beginner in c++. i want to create multiple arrays with different size at run time. i tried the below codes which got compiled and ran. But it seems not right after comparing with other answers i googled. Mostly of the results say it should be done using new and delete or vector or some other library implementations. Can anyone help point out what is wrong with it?
void Basics::TestArray(int length){
int arr[length];
for(int i=0;i<length;i++){
arr[i] = i;
}
}