title: c++ what happens if you print more characters with sprintf, than the char pointer has allocated?
body: <p>I assume this is a common way to use sprintf:</p>
  
  <pre><code>char pText[x];
  sprintf(pText, "helloworld %d", Count );
  </code></pre>
  
  <p>but what exactly happens, if the char pointer has less memory allocated, than it will be print to?</p>
  
  <p>i.e. what if x is smaller than the length of the second parameter of sprintf?</p>
  
  <p>i am asking, since i get some strange behaviour in the code that follows the sprintf statement.</p>