title: Beginning C: Behavior Printing Strings
body: <p>I'm learning C and am currently experimenting with storing strings in variables. I put together the following to try different stuff.</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  int main() {
      char *name = "Tristan";
      char today[] = "January 1st, 2016";
      char newyear[] = {'H','a','p','p','y',' ','N','e','w',' ','Y','e','a','r','!','\n'};
      printf("Hello world!\n");
      printf("My name is %s.\n", name);
      printf("Today is: %s.\n", today);
      printf(newyear);
      return 0;
  }
  </code></pre>
  
  <p>After compiling this code and running it, I get the following results:</p>
  
  <pre><code>Hello world!
  My name is Tristan.
  Today is: January 1st, 2016.
  Happy New Year!
  January 1st, 2016
  </code></pre>
  
  <p>Now this is pretty much what I would expect, by why would "January 1st, 2016" get printed out again at the end of the program's output?</p>
  
  <p>If I take the "\n" out of the "newyear" array, it will not do this.</p>
  
  <p>Would someone please explain why this is?</p>