cin.get() ASCII code is different than ASCII code of already set char in code
<p>I'm having a problem with <code>cin.get()</code>:</p>

<p>While getting a char, I am converting it to int, but when I enter it through console, the result is different than when its already set in code.</p>

<p>Here is example:</p>

<pre><code>int ord(unsigned char chr){
    int ret=int(chr);
    return ret;
}
int main(){
    unsigned char chr='ň'; //This is my constant character 'ň' for now
    cout&lt;&lt;ord(chr)&lt;&lt;endl; //outputs : 242 ,which is alright for me, because it is same as in PHP and that I need
    chr=cin.get(); //now I change my constant character 'ň' to 'ň' written through console 
    cout&lt;&lt;ord(chr)&lt;&lt;endl; //outpus : 229 ,which is wrong for me, because its not same as in PHP 
}
</code></pre>

<p>How can I fix this?</p>

<p>I want to get 242, not 229, it must be same as ord()'s result in PHP.</p>
