Q:

C++ Meaningless expression filler

I have this simple c++ program for a console application in VS 2013 Express (for Windows Desktop):
#include <iostream>
#include <string>
using namespace std;

int main()
{
string mystr;
cout << "Welcome, what is your name? ";
getline(cin, mystr);
cout << "Nice to meet you, " << mystr << endl;
cout << "May i call you \"Idiot\" for short? (y/n)" << endl;

string mystr2;
getline(cin, mystr2);

while ( ??? ) 
{
    if (cin)
    {
        if (mystr2 == "y")
        {
            cout << "Thank you, Idiot" << endl;
        }
        else
        {
            if (mystr2 == mystr)
            {
                cout << "You found the hidden secret! The hidden secret is..... I dunno. It is what ever you want it to be. \n \nProbably a let down." << endl;
            }
            else
            {
                if (mystr2 == "n")
                {
                    cout << "Ok then, " << mystr << endl;
                }
                else
                {
                    cout << "Please enter a valid response (y/n)" << endl;
                    getline(cin, mystr2);
                }
            }
        }
    }
}

}
I've just started to learn and i prefer to learn as i make something, so i decided to do this. As you may guess from the final else statement, i want it to say "Please enter a valid response (y/n)" if the user has put in anything other than y, n or mystr2 == mystr. It works fine but i need to it loop so i have put it all in the while statement. 
I now need an expression for the while statement which won't effect it, or is a result of the user triggering the last else statement. This filler is what i need help with.
I know it is small and pointless but i want to finish it.

A:

getline returns a reference to the stream from which it was reading. And all streams provide an implicit conversion to bool which results in true if the stream is valid (i.e. if the last operation succeeded). So it's pretty idiomatic to do this:
string mystr2;

while (getline(cin, mystr2))
{
    if (mystr2 == "y")
    {
        cout << "Thank you, Idiot" << endl;
    }
    else
    {
        if (mystr2 == mystr)
        {
            cout << "You found the hidden secret! The hidden secret is..... I dunno. It is what ever you want it to be. \n \nProbably a let down." << endl;
        }
        else
        {
            if (mystr2 == "n")
            {
                cout << "Ok then, " << mystr << endl;
            }
            else
            {
                cout << "Please enter a valid response (y/n)" << endl;
            }
        }
    }
}

A:

You can simply use while(true) for the loop to execute indefinitely. If you ever want it to stop, you must break or return

