Hello 2 questions, when you've got this:
char * array = new char;
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; 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
How could this be accomplished? Via making and copy the data to a new array?
strcpy if im correct 'copies' the data from array?