Stack overflow for string in C++?
<p>I made a small program that looked like this:</p>

<pre><code>void foo () {
  char *str = "+++"; // length of str = 3 bytes
  char buffer[1];

  strcpy (buffer, str);

  cout &lt;&lt; buffer;
}

int main () {
  foo ();
}
</code></pre>

<p>I was expecting that a stack overflow exception would appear because the buffer had smaller size than the str but it printed out +++ successfully... Can someone please explain why would this happened ? 
<br>Thank you very much.</p>
