读书人

CString转换为LPCTSTR有关问题

发布时间: 2012-03-09 16:54:58 作者: rapoo

CString转换为LPCTSTR问题

C/C++ code
#include "iostream"#define _AFXDLL#include "afx.h"#pragma comment(linker,"/ENTRY:TEST")using namespace std;int TEST() {    LPCTSTR xx = CString("asdfas");    cout << xx << endl;    cin.get();    return 0;}

这段代码错在哪里啊?谢谢回答 。

[解决办法]
LPCTSTR是个指针类型。
而CString是个C++的类。
C/C++ code
LPCTSTR xx = CString("asdfas"); 

读书人网 >C++

热点推荐