title: abnormal behaviour in cout. It is printing twice character array after declaration of another same valued character array
body: <p>So I was writing the code to print a character array in c++. The normal code is:-</p>
  <pre><code>#include &lt;iostream&gt;
  using namespace std;
  
  int main()
  {
      char X[5] = {'A', 'B', 'C', 'D', 'E'};
      cout &lt;&lt; X &lt;&lt; endl;
      return 0;
  }
  </code></pre>
  <p>and it's printing:-<code>ABCDE</code> as expected but I tried to create another character array like this</p>
  <pre><code>#include &lt;iostream&gt;
  using namespace std;
  
  int main()
  {
      char X[5] = {'A', 'B', 'C', 'D', 'E'};
      char Y[5] = {'A', 'B', 'C', 'D', 'E'};
      cout &lt;&lt; X &lt;&lt; endl;
      return 0;
  }
  </code></pre>
  <p>and I thought that I'll get same output but it didn't happend.
  the output was <code>ABCDEABCDE</code> I didn't understood why it happened.<br />
  At that time I was coding in my computer. So, I visited online c++ compiler and still got the same result.<br />
  Please anyone help me to understood why it happened?
  I am using C++14 in my computer.
  This is the link of <a href="https://www.programiz.com/cpp-programming/online-compiler/" rel="nofollow noreferrer">online compiler website</a> on which I rechecked my code.</p>