Hello 2 questions, when you've got this:
char * array = new char[20];
creates a dynamic array of 20, if on run time the array needs to be 40 how could this be accomplished? I've thought i'd fill the array and if the next element that requires adding goes out of boundsn create a new array and copy the data over? Fair enough this is a big overhead in terms of time access.
Also if you have an array like this:
char * array = new char[20];
array = "World";
this create an dynamic array of 20 bytes and populates it with "World" , however if i then go away and want to add something to the beginning of the array, ie
"Hello"
How could this be accomplished? Via making and copy the data to a new array?
strcpy if im correct 'copies' the data from array[0]?
Thanks guys,
John