String reverse program throws exception
<pre><code>// ExampleCodes.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"
#include&lt;stdio.h&gt;
#include&lt;iostream&gt;
using namespace std;    

char* stringReverse(char* s)    
{    

    char temp, *p,*q;    
    q = s;    
    while( *(++q));    
    for( p = s; p &amp;lt; --q; p++)    
    {    
        temp = *p;    
        *p = *q;     
        *q = temp;    
    }    
    return s;    
}    


int _tmain(int argc, _TCHAR* argv[])    
{    

    stringReverse("StringReverse");    
    return 0;    
}    
</code></pre>
