sprintf outputs an extra string
<p>Using sprintf outputs an extra string, like "%x ...."</p>

<pre><code>int main()
{   
    char *word_tmp = new char[0];
    char *word_all = new char[0];

    for(int i=0;i&lt;5;i++)
    {
        sprintf(word_tmp, "\nNumber:%d, Good Good!", i);
        sprintf(word_all, "%s%s", word_all, word_tmp);   
    }

    std::cout&lt;&lt;word_all;
}
</code></pre>

<p>The program works right, but outputs a string I have not output. </p>
