title: Printing ASCII in C
body: <p>I'm trying to write a program that'll print out all ASCII characters using for loops, but it keeps going on infinite loop unless I take out 127, am I doing something wrong or is that how ASCII behaves?</p>
  
  <p>This will crash (infinite loop):</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  
  int main (void)
  {
  
  for (char i = -128; i &lt;= 127; i++)
  {
      printf("%d = %c\n", i, i);
  }
  
  return 0;
  }
  </code></pre>
  
  <p>But this is fine:</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  
  int main (void)
  {
  
  for (char i = -128; i &lt; 127; i++)
  {
      printf("%d = %c\n", i, i);
  }
  
  printf("%d = %c\n", 127, 127);
  
  return 0;
  }
  </code></pre>