How can I check whether a user enters the same number twice? C++ Help?
<p>I just need quick help.  Here's a breakdown of some code:</p>

<pre><code>char userLetter;
int userNumber;

cout &lt;&lt; "Please enter a letter: ";
cin &gt;&gt; userLetter;

while(userLetter == 'A')
{
     cout &lt;&lt; "Please enter a number: ";
     cin &gt;&gt; userNumber;

     //do something in the loop here

     cout &lt;&lt; "Please enter a letter: ";
     cin &gt;&gt; userLetter;
}
</code></pre>

<p>Now I basically need to add something that will tell the user his entry is invalid if he enters the same number more than once.  For example, let's say the user enters the letter A and the number 2.  The while loop executes whatever it needs to do and then asks the user for a letter again.  Let's say the user enters 'A' again.  The loop then asks the user for another number, if the number is 2 again, the program should tell the user it's an invalid entry.</p>

<p>Any help?</p>
