How to have a char pointer as an out parameter for C++ function
<p>I'm a newbie to C++. I'm trying to have a char pointer as an out parameter for a function. But the changes made in the function are not reflected in the main function. What am I doing wrong?</p>

<pre><code>void SetName( char *pszStr )
{
    char* pTemp = new char[10];
    strcpy(pTemp,"Mark");
    pszStr = pTemp;
}

int _tmain(int argc, _TCHAR* argv[])
{
    char* pszName = NULL;
    SetName( pszName );
    cout&lt;&lt;"Name - "&lt;&lt;*pszName&lt;&lt;endl;
    delete pszName;
    return 0;
}
</code></pre>
