c++ switch and while loop
<p>I'm having a few problems correctly implementing a C++ switch statement within a while loop. </p>

<p>I'm testing for the char '0', yet when I press this key on my keyboard and hit enter, the loop still continues.</p>

<p>Could anyone please tell me why this would be? Could it be something to do with my keyboard or ascii set or something along those lines? </p>

<p>Here is my source, please excuse my big annoying comments, I'm using a 13" screen so they help me.</p>

<pre><code>#include "Character.h"

using namespace std;

int main()
{
    char tmp;
    Character* kite;
    kite = new Player();

    ////////////////////////////
    // Name
    ////////////////////////////
    cout &lt;&lt; "\n\t\tPlease enter your name:\n\t\t";
    cin &gt;&gt; tmp;
    kite-&gt;setName(tmp);

    ////////////////////////////
    // Weapon
    ////////////////////////////
    cout &lt;&lt; "\n\n\t\tPlease Select your Weapon of choice:\n";
    const int MAXITEMS = 3;
    string lastItem;
    string inventory[MAXITEMS] = {"Sword", "Staff", "Double Blades"};
    string replaceItem;
    string addItem;
    // print what is in inventory to start with


    for (int i = 0; i &lt; MAXITEMS; i++)
    {
            lastItem = inventory[i];
            cerr &lt;&lt; "\t\t" &lt;&lt; i &lt;&lt; ") " &lt;&lt; inventory[i] &lt;&lt; endl;
    }

    bool done = false;
    char choice;
    cin &gt;&gt; choice;

    while(!done)
    {
        switch(choice)
        {
            case '0':
                kite-&gt;setWeapon(inventory[1]);
                done=true;
                break;
        }
        if(done)//I added this in lately to try to overcome issue
        {
            break;
        }
    }

    return 0;//exit code
}
</code></pre>
