C++ unreasonable result of pointer arithmetics in microsoft visual studio 2015 : <p>I found a very interest phenomenon in pointer arithmetics. I am using microsoft visual studio 2015<br>
I have the following program</p>

<pre><code>#include&lt;iostream&gt;
using namespace std;
void testFunction2(const char *s, int n)
{
    unsigned int x;
    for (x = n - 1; x &gt;= 0; --x)
        cout &lt;&lt; *(s + x);
}
int main()
{
    char str[80] = "string";
    testFunction2(s, strlen(s));
}
</code></pre>

<p>It is expected to print <code>str</code> reservely, ie. gnirts, however, it print endless Mojibake and the alarm is on.<br>
But if I change the second condition in the for loop from
<code>x&gt;=0</code> to <code>x&gt;=1</code>.
it will print "gnirt", as expected.<br>
I have also tried code like<code>cout&lt;&lt;*(str+0);</code>, it will print the first character of <code>str</code>, as expected.</p>

<p>The results contradict themselves.
what is the problem?  I would also like to know if this problem exist uniquely in visual studio?</p>
