Writing a string backwards my way, sometimes results into extra output, related to the character ' w '
<p>This has been boggling me, the simple code:</p>

<pre><code>int main()
{
    typedef std::string::size_type stype;
    std::cout &lt;&lt; "What is your first name?\n";
    std::string first,second,fullname;
    std::cin &gt;&gt; first;
    std::cout &lt;&lt; "What is your second name?\n";
    std::cin &gt;&gt; second;
    char * backwards;
    fullname = first + " " + second;
    stype fnsize = fullname.size();    
    backwards = new char [fnsize];
    stype b = 0;
    for(stype a = fnsize; a != 0; --a)
    {
       backwards[b++] = fullname[a - 1];
    }
    std::cout &lt;&lt; backwards &lt;&lt; std::endl;
    return 0;
}
</code></pre>

<p>Works most of the time, but when I write a name like my own, <em>stanislaw terziev</em>, I get an output <em>veizret walsinatsslaw</em> instead of <em>veizret walsinats</em></p>

<p>Why is it so?</p>
