Hi all, currently I need to write a program that asks the user to type names (once) and as they type names and hit enter, each name gets put into a string array. When the input is "DONE", the program moves on and stops writing to the name array (ignoring DONE as a name obviously).
My question is, how would I go about coding the loop to do this? I've tried a few whiles but I keep getting errors regarding comparing cin and "DONE". I've never had to record inputs like this, I'm used to inputs such as "name name name name name DONE" then break it up into elements, this however just operates as "name enter, name enter, name enter, DONE enter etc."
How would I go about forming the loop for this?
PS I also need to update a counter variable to keep track of the number of people/elements in the array, however that shouldn't be an issue for me to incorporate within the loop.