Answer the question
In order to leave comments, you need to log in
Answer the question
In order to leave comments, you need to log in
Dynamic arrays
Select the minimum number, if more is needed, then allocate space for a larger one and copy the existing ones there. It all depends on how much and how often you have to write there.
But in order not to take a steam bath, you can use lists
#include <iostream>
using namespace std;
void main()
{
int count;
cout << "Input count of elements: ";
cin >> count;
int* arr = new int[count]; // Вот Ваш массив с указанным пользователем количеством элементов (count)
delete[] arr;
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question