Reading a collection of strings from the user
Don't forget to check the stream status for errors or EOF.

while (cin &gt;&gt; temp &amp;&amp; temp != ".")
{
    params.push_back(temp);
}




EDIT: You do not necessarily need to invent your own break condition. There's one already — end of file. You can just read strings until you reach it. This way, your program will also work with non-interactive input nicely. To generate an end of file on a terminal, type Ctrl+D on Unix/Linux and Ctrl+Z on Windows.

while (cin &gt;&gt; temp)
{
    params.push_back(temp);
}