Comparing C++ input with array values
<p>Over the last couple months I've still been slowly but surely trudging through C++, and I've run into a snag that I've been meaning to figure out.  I've tried asking/reading/searching, but I could never find an appropriate answer.  Maybe it is simply because the question is sort of difficult to ask.  </p>

<p>What I'm trying to do is at the end of my program, have the end sequence compare the input value with values within an Array.  Do I have to loop a comparison sequence?  Is there an easier way around this?  </p>

<pre><code>#include &lt;iostream&gt;
#include &lt;string&gt;
using namespace std;

int main () {

    string YesAnswers[5] = {"Y", "YES", "yes" "y"};
    string Name;
    string YN;

    do {
        cout &lt;&lt; "Enter your name: ";
        getline(cin, Name);

        cout &lt;&lt; "Your name is "&lt;&lt; Name;

        cout &lt;&lt;"\nIs this correct? Y\N: ";
        cin &gt;&gt; YN;

    } while(YN == YesAnswers);

    system("Pause");
    return 0;
}
</code></pre>
