Subtracting two chars and adding them to a string
<pre><code>#include &lt;iostream&gt;
#include &lt;string&gt;

int main() { 
    char s2;
    s2 = '1' - '0';
    std::cout &lt;&lt; s2;
    std::cout &lt;&lt; std::endl;
    std::cout &lt;&lt; '1' - '0';
    std::cin &gt;&gt; s2;
}
</code></pre>

<p>The output produced is:</p>

<pre><code>☺
1
</code></pre>

<p>My question is, why are the two lines different? I expected and wanted both results to be <code>1</code>. By my understanding they should be the same but that is obviously wrong, could somebody please explain this to me? Thank you</p>
