Hello I am trying to figure out how I can use a while loop to construct an object and ask the user if they want to construct another one and add 1 to the name. For instance I am creating an Employee class that I want the name of the objects to be e1, e2.... Basically I have this but I want to add 1 to the name each time the user says yes and create a new object:
int i = 1;
while(answer =="y")
{
Employee (emp + i) = new Employee();
i++;
}
So the first time it would be e1, then the next would be e2 and so on. I know this is isnt nice looking but I just want to know what I need to use to get something like this to work.