LPSTR LPCTSTR explanation
<p>I have the following c++ code:</p>

<pre><code>#include "stdafx.h"
#include &lt;atlstr.h&gt;

int _tmain(int argc, _TCHAR* argv[])
{
    CString OFST_PATH;
    TCHAR DIR_PATH[MAX_PATH];

    GetCurrentDirectory(MAX_PATH, DIR_PATH);

    OFST_PATH.Format(DIR_PATH);

    CHAR *pOFST_PATH = (LPSTR)(LPCTSTR)OFST_PATH;

    return 0;
}
</code></pre>

<p>I want to understand why the value of <code>pOFST_PATH</code> in the end of the program is "c"?  what did <code>(LPSTR)(LPCTSTR)</code> casting of variable <code>OFST_PATH</code> did to the whole path that was written in there?</p>

<p>As you can see in the following window, when debuging the variables values are:</p>

<p><a href="https://i.stack.imgur.com/YH7wp.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/YH7wp.jpg" alt="enter image description here"></a></p>