Taking char 'e' as input and comparing
<p>OK, so I am doing an exercise in a book, converting different types of money to dollars.  For some reason when I type in 'e' as input for a char variable and compare it to 'e' in an if statement the comparison doesnt work, however if I replace it with another letter it will work fine.  What's the deal?  Heres the code:</p>

<pre><code>int main()
{
    const double yen_per_dollar = .013;
    const double pound_per_dollar = 1.55;
    const double euro_per_dollar = 1.29;

    double amount = 1;
    char unit = ' ';

    std::cout &lt;&lt; "Please enter a amount followed by a unit (p, y, or e): ";
    std::cin &gt;&gt; amount &gt;&gt; unit;

    if (unit == 'y')
        std::cout &lt;&lt; amount &lt;&lt; " yen is $" &lt;&lt; amount * yen_per_dollar &lt;&lt; " dollars.\n";
    if (unit == 'p')
        if (amount == 1)
            std::cout &lt;&lt; amount &lt;&lt; " pound is $" &lt;&lt; amount * pound_per_dollar &lt;&lt; " dollars.\n";
        else
            std::cout &lt;&lt; amount &lt;&lt; " pounds is $" &lt;&lt; amount * pound_per_dollar &lt;&lt; " dollars.\n";
    if (unit == 'e')
        if (amount == 1)
            std::cout &lt;&lt; amount &lt;&lt; " euro is $" &lt;&lt; amount * euro_per_dollar &lt;&lt; " dollars.\n";
        else
            std::cout &lt;&lt; amount &lt;&lt; " euros is $" &lt;&lt; amount * euro_per_dollar &lt;&lt; " dollars.\n";
    else 
        std::cout &lt;&lt; "Sorry, that input isn't in the correct format." &lt;&lt; std::endl;
    std::cin &gt;&gt; amount; // Keeps window open
}
</code></pre>
