title: Store an integer in a char array
body: <p>I am trying to store an integer in a <code>char</code> array. How can I do that? This is my approach (by casting it the <code>int</code> to a <code>char</code>) but it does not work. What am I missing?</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  
  int main(int argc, char** argv) 
  {
      char cArray[10] = {};
  
      // Store a character in the char array
      cArray[5] = 'c';
      printf("%c\n", cArray[5]);
  
      // Store an integer in the char array
      cArray[6] = (char) 0; // WHY DOES THIS NOT WORK???
      printf("%c\n", cArray[6]);
  }
  </code></pre>