title: Recursive number function returns unexpected values
body: <p>After searching extensively for a function that would convert integers into visually equivalent strings and finding nothing, I decided to write my own.</p>
  
  <p>The function "ascii" takes three arguments: the integer to be converted, the string to hold the converted integer, and a counter that is meant to be left at 0.</p>
  
  <pre><code>void ascii(int c, char str[], int k) {
      if (c &lt;= 9) {
          str[k] = c + '0';
      }
  
      else if (c &gt;= 10) {
          str[k] = c / 10 + '0';
          ascii(c % 10, str, k + 1);
      }
  }
  </code></pre>
  
  <p>Testing this function with a single-digit number turns up nothing unexpected, but on bigger numbers, things start to get messy. 76 becomes "761", 765 becomes "|51", and 7658 becomes "-81". The more digits the number is comprised of, the less sense I can make out of the resulting string. What gives?</p>