Using a variable as an array size

I want an array that holds information about customers. The problem is is there could be an infinite number of customers. So when a new customer is added then the array needs to get larger. Is it possible to use a variable that I can increment for each new customer?
Last edited on
If you write in C++ you have the option of stl, but if you want to write something without STL you will need to dynamically allocate. Depending on if your program will need to "grow" the array you will probably want to use STL unless you want to write code that resizes the dynamically allocated array. If you only need to be able to initialize it with a value you input, dynamically allocating is fine. But it means you have to make sure you don't overwalk the array. Personally it is a good way to learn arrays.
Topic archived. No new replies allowed.