问:VC中各种字符串类型是怎么转换的?
在vs2005的帮助文档中看到以下例子:
CFile f;
CFileException e;
char* pFileName = "test.dat";
if( !f.Open( pFileName, CFile::modeCreate | CFile::modeWrite, &e ) )
{
#ifdef _DEBUG
afxDump << "File could not be opened " << e.m_cause << "\n";
#endif
}
但是我自己试验的时候,却有错误:error C2664: 'CFile::Open' : cannot convert parameter 1 from 'char *' to 'LPCTSTR';
不知道VC中各种字符串类型之间有什么关系呢,又怎么转换呢?