有如下一C问题求教各位高人:
         int nLength=m_strName.GetLength()+1;
         TCHAR* pTchar=new TCHAR[nLength];
         ::ZeroMemory(pTchar,nLength);
#ifdef UNICODE
::wcscpy(pTchar,(LPCTSTR)m_strName);
#else
::strcpy(pTchar,(LPCTSTR)m_strName);
#endif
         //pTchar[nLength]=NULL;(或者是pTchar[nLength]=’\0’;)
         delete []pTchar;
问题描述:如果不把pTchar[nLength]=NULL语句注释掉则可执行程序在执行时会产生
异常,显示设置零中止符为什么会产生异常。