I'm learning about classes in c++ and am working on a project that requires me to read in input from a file and make class objects based on what is read in. I don't know how many objects need to be created. I also can't use vectors. How can I create class objects in a loop with different names?
while(!inFile.eof())
{
// Create class objects
}
Is this even possible?
Edit: By names, I meant identifiers. I have class objects that are of type Ship. I need to make multiple Ship objects iteratively after reading input from a file. I need to be able to access the members of each ship object throughout the program's runtime. I have other classes like Dock and LinkedList that have Ship pointers as members that I need to attach the created Ship objects to based on file input. I don't know how many Ship objects need to be made. I can't use vectors.