c++ How to convert String to int (ascii code to value); : <p>i have been trying to make a program that checks if a national identification number is valid how ever i have run into a issue and i can't find an answer anywhere.
  I am using a string to store the users input of the identification code and i need to somehow covert the string to int keeping the symbol instead of getting an ascii value.</p>

<p>Example:
(lets say the user inputs the string persKods as 111199-11111
the 5th symbol is 9 so the year value should output as 9 instead of 54 which is its ascii value)</p>

<pre><code>int day,month,year;
year=this-&gt;persKods.at(4);
cout &lt;&lt; year; // it outputs 54 instead of 9 :/
</code></pre>
