Like you start with
int size = 10;
int *array = new int[size];
And to make it bigger, int *bigger = new int[size+10];
// some stuff
delete [ ] array;
array = bigger;
What goes in "some stuff" is an exercise for the reader ;)
Salem
Posting Sage
11,531 posts since Dec 2005
Reputation Points: 5,862
Solved Threads: 953
Assume that the array is a fixed size (ie, a regular array), and write some code to put data into it.
Turning it into a variable length array (once you've done that) is only a few lines of code.
At least it allows you to focus on one issue at a time.
Salem
Posting Sage
11,531 posts since Dec 2005
Reputation Points: 5,862
Solved Threads: 953