[try Beta version]
Not logged in

 
Adding values to an existing array

Mar 12, 2013 at 6:41pm
closed account (oj8RX9L8)
Hi, I'm creating a program that requires values to be added to a existing array.
eg. The user initially creates a array that holds 6 strings, then decides to add 5 more strings onto the same array.

Currently when declaring the array I have the number of elements set to a very large number to ensure the array doesn't go out of bounds when adding more values onto it.

Is there any other way of doing this?
Mar 12, 2013 at 8:50pm
Best way is to use dinamically sized container as std::vector: http://cplusplus.com/reference/vector/vector/
Topic archived. No new replies allowed.