I need to make an array of pointers to a string where i allocate about 19 bytes. After the 19 is used i have to increment 10 each time it is filled; so ill have 29 when 19 is filled.
I think i need to use the newand deletefunctions but how would i implement this?
Btw im filling the array with ASCII characters from 0 to z.
Should i make a string array: string arr[19]; and fill it using a for loop. Then once the for loop is complete use operator new to allocate 10 more?
You have a major memory leak there. On line 31, each iteration of the loop you are failing to delete[] whatever ascii is pointing at before re-assigning it.
You delete[] ascii, allocate a new one exit the loop and try to print the first string. You aren't putting anything in it. See lines 31 - 35 (with doit = 0).