title: how can I convert a char character representing a number, to the same number in int?
body: <p>I am trying to figure out how to convert a char number, say </p>
  
  <pre><code>char num = "1";
  </code></pre>
  
  <p>to the same number as an integer so </p>
  
  <pre><code>char num = "1"; would be converted to int numc = "1";
  </code></pre>
  
  <p>and the only way that I can think of to do it is to manually do a bunch of if statements, which seems a bit excessive, so I was just wondering if anyone knew of an easier way to do this? thanks!  </p>