title: Why can I pass an int with a value higher than 127 into a char array, but not directly?
body: <p>I understand that a char value cannot be represented as 176, but some byte systems are unsigned (0-255) while others are signed (-128 to 127). In this case I'm working with unsigned, so I just wanted to create a simple byte message array, but I get this error when trying to place a higher value than 127, but if I declare it as an int first it avoids the error. Can someone explain in detail why this works? </p>
  
  <p><strong>Method 1: Doesn't work. I get this error: narrowing conversion of ‘176’ from ‘int’ to ‘char’</strong></p>
  
  <pre><code>char m1[3]{ 176, 118, 1 };
  </code></pre>
  
  <p><strong>Method 2: This works</strong></p>
  
  <pre><code>int b1 = 176;
  char m1[3]{ b1, 118, 1 };
  </code></pre>