you were trying to delete the cptr array itsself. not the things inside it, so I added a loop to do this

array values start at 0 so I changed some loops or you would get segmentation faults trying to access the item above the one you wanted (eg 2 items you would have instead of 0 and 1, printed item 1 and 2 (and 2 would not exist!!))

maybe not necessarily, but I added memsets to make sure the string terminates (if its filled with rubbish it may think its longer than it actually is)

removed system("pause") in favour of cin.get() (does the same thing but cin.get() is less resource heavy ect..)

this now compiles ok with minGW and runs fine for me. see if it works for you.