I have created a class that contains a simple character array, and I'm trying to create an array of that class, initializing all the member character arrays upon declaration. The problem is, I need to be able to destroy the array and re-create it later, since my array sizes are causing overflow errors if I simply create a new array for each use. To be specific, my class is called city, and contains among other things a character array that contains the city's name. I already have the constructor that will initialize the cityname that's passed to it, that part is working fine.
My program reads in multiple text files, one at a time, and parses them to extract info from them for insertion into a SQL database. Each file contains records from 1 state, but parsing multiple files means that each file might have records for a new state. My array of citynames should at any time contain all the cities for the current state, and should be destroyed at the end of the file to free up the memory. Upon opening the next file, I need to create a new array with the city names for that state. Essentially, I need the equivalent of the following statement (which doesn't work for obvious reasons, but I wish it did)
city* citylist=new city[]={"city1","city2","city3"...};

The following code successfully creates a citylist:
city citylist[]={"city1","city2","city3"...};
But I can't destroy an array made like that.
Any ideas?
-Moedaddy