title: In c++, how does the language handle type promotion of char to integers in an iteration?
body: <p>The idea of this project was to create an array of characters with numbers like this. </p>
  
  <pre><code>char some_numbers[] = {'0', '1', '2', '3', '4', '5'};
  </code></pre>
  
  <p>I made an integer of the size of that array right below that with.</p>
  
  <pre><code>int array_size = sizeof(some_numbers) / sizeof(*some_numbers);
  </code></pre>
  
  <p>What I wanted to try out was a simple iteration where instead of going through each iteration to show characters, I simply wanted to just type promote within the for loop to show a true integer. For example, I know that if you changed some_numbers[0] to an integer, you will get a value of 48. I used just this very idea of type promotion inside the for loop parameters that I created like this.</p>
  
  <pre><code>for (int i = int(some_numbers[0]); i &lt;= int(some_numbers[array_size]); ++i)
  </code></pre>
  
  <p>What I did next was simply just have the body of this for loop execute a simple arithmetic expression to show a real integer value. This is the whole thing I typed out.</p>
  
  <pre><code>for (int i = int(some_numbers[0]); i &lt;= int(some_numbers[array_size]); ++i)
  {
     std::cout &lt;&lt; int(some_numbers[i]) - int(some_numbers[0]) &lt;&lt; std::endl;
  }
  </code></pre>
  
  <p>The whole thing that I wanted as an output was 0 1 2 3 4 5 but I'm just not getting anything. Where and what went wrong? How exactly should I shift my approach in the first place to get the output in the correct way for the correct data type I want?</p>