0

How to let the user input the size of the array?

i always get an error when i do this on my program int size; int arr[size] ;

18th Dec 2018, 7:51 AM
Neilvin Enteria
Neilvin Enteria - avatar
1 Odpowiedź
+ 1
Try dynamic allocation .. something like : int *arr= new int[size]; https://code.sololearn.com/cUznXCtYeX8b/#cpp
18th Dec 2018, 8:10 AM
Prokopios Poulimenos
Prokopios Poulimenos - avatar