title: How can I convert a string of characters to multiple int values? C++
body: <p>I'm working on homework and the professor wants us to make this function. I'm having trouble understanding how to create it. This is the code I have modified several times. I have tried storing the string in array, or char array. And I tried using pointers. Below is a picture of the homework and my code I currently have.</p>
  <p><img src="https://i.stack.imgur.com/N7Sdv.jpg" alt="Homework Function" /></p>
  <pre><code>    int valueOf(char a) {
          string alphabet = &quot;abcdefghijklmnopqrstuvwxyz&quot;;
          string* ptr = &amp;alphabet;
  
          alphabet[1] = 10; 
  
          if (a &gt;= 0 &amp;&amp; a &lt;= 9) {
              return a;
          }else if(a == alphabet.){
          
  
          }
      }
  </code></pre>