title: Printing char array with null character in the middle in C
body: <p>I have noticed that when you try to print a null character in C, nothing will get printed.</p>
  
  <pre><code>printf("trying to print null\n");
  printf("%c", '\0');
  </code></pre>
  
  <p>However, I am trying to print the characters in the following array one by one, up to the sixth character which is the null character.</p>
  
  <pre><code>char s[] = "Hello\0Bye";
  int i;
  for(i = 0; i &lt; 7; i++) {
      printf("%c", s[i]);
  }
  printf("\n");
  </code></pre>
  
  <p>I was expecting "Hello" to be printed, as since the sixth character is null nothing will be printed. However my output was: "HelloB".
  It seems like printf skipped the null character and just went to the next character. I am not sure why the output is "HelloB" instead of "Hello".</p>
  
  <p>Any insights would be really appreciated.</p>