title: whats the difference for indexing of signed and unsigned char in array?
body: <p>I have to following code, which doesn't generate my expected results. Adding unsigned char would make it work. ( I realized it is not working by having another function doing the reverse, but not getting the reverse effect!)
  Can someone explain a bit to me.</p>
  
  <p>The code is to substitute a 8 char string to some random chars. </p>
  
  <p>My current code :</p>
  
  <pre><code>char subs[8][256];
  
  void perfSubs(char* input){
  for (int i = 0; i &lt; 8; i++)
      input[i] = subs[i][input[i]];
  }
  </code></pre>
  
  <p>I should change it to </p>
  
  <pre><code>input[i] = subs[i][(unsigned char)input[i]];
  </code></pre>