0
How to input int values from user n store it in array dynamically in c++?
5 Antworten
+ 8
abhishek khanna you cannot do that with arrays even not with the dynamic arrays.
You can do that either with Vector or Linked-List
+ 1
Do you mean something like this?
cin >> n;
int* arr = new int [n];
for (int i = 0; i<n; i++) cin >> arr[i];
+ 1
I tried your code but it didn't help.
I am looking for a code which take input from user and store it in an array, without setting the limit of array
+ 1
I'll think about it but maybe you want to use list? https://www.sololearn.com/learn/645/?ref=app
0
Thank you everyone