The program takes in strings from user input into words separated by white space,comma, and newline so that each word can be added to a vector as an individual element (the user terminates the program by initiating EOF via CTRL + D). I want the vector to be emptied when the user types in the dot character "." on a line by itself.
The following code with the commented part is the troubles I'm having. I want the big while loop to take inputs one line at a time so I can compare that to "." to check if "." is by itself. I seem to have too many while loops and so I can't initiate EOF (CTRL + D) because of one of them--how can I simplify the mess I have while being able to initiate EOF, process the string into elements for a vector and still be able to terminate when the user types "," on a line by itself?
Thank you and much appreciated--have been working on this simple program for hours.
That is to check if the line from user input is just the dot character by itself, which signals the vector to be cleared so I can use it for the next input. I commented the "if" part because I was trying to find a way to reduce the while loops since I'm currently stuck in one of them when I run the program--EOF can't even be initiated by the user via CTRL + D on Linux or CTRL + Z on Windows.