error C2440: “初始化”: 无法从“const char [5]”转换为“LPTSTR”问题求解
#include"GameEngine.h"#include"Sprite.h"#include"resource.h"GameEngine*g_pGE;typedefs...
#include"GameEngine.h"
#include"Sprite.h"
#include"resource.h"
GameEngine *g_pGE;
typedef struct tagDIALOG{
LPTSTR szName;
LPTSTR szTalk;
}DIALOG;
DIALOG g_dlg[5]={{"海彬","离开阿绵吧,他是我的。"},
{"昊原","不行,我深爱着他。"},
{"海彬","这是你的最终决定?"},
{"昊原","没错,原谅我。"},
{"海彬","来,战个痛快!"}
};
int g_nDialigIndex;
Sprite*g_pSprBackGround;
Sprite*g_pSprFoeman;
Sprite*g_pSprGirl;
Sprite*g_pSprDlg;
Sprite*g_pSprSceneTitle;
Sprite*g_pSprSceneLoc;
RECT g_rTalk={170,490,700,580};
RECT g_rName={170,460,220.500};
int g_nSceneTitleAlpha;
int g_nXFoeman,g_nYFoeman,g_nXGirl,g_nYGirl;
这是代码,问题就在对话那里,但是真心不知道怎么弄,求解释!!! 展开
#include"Sprite.h"
#include"resource.h"
GameEngine *g_pGE;
typedef struct tagDIALOG{
LPTSTR szName;
LPTSTR szTalk;
}DIALOG;
DIALOG g_dlg[5]={{"海彬","离开阿绵吧,他是我的。"},
{"昊原","不行,我深爱着他。"},
{"海彬","这是你的最终决定?"},
{"昊原","没错,原谅我。"},
{"海彬","来,战个痛快!"}
};
int g_nDialigIndex;
Sprite*g_pSprBackGround;
Sprite*g_pSprFoeman;
Sprite*g_pSprGirl;
Sprite*g_pSprDlg;
Sprite*g_pSprSceneTitle;
Sprite*g_pSprSceneLoc;
RECT g_rTalk={170,490,700,580};
RECT g_rName={170,460,220.500};
int g_nSceneTitleAlpha;
int g_nXFoeman,g_nYFoeman,g_nXGirl,g_nYGirl;
这是代码,问题就在对话那里,但是真心不知道怎么弄,求解释!!! 展开
2个回答
展开全部
Compiler Error C2440
'conversion' : cannot convert from 'type1' to 'type2'
The compiler was unable to cast from ‘type1’ to ‘type2.’ If you’ve encountered this error on code which compiled with an earlier version of Visual C++, please read Technote: Improved Conformance to ANSI C++ for more information.
The following example illustrates this error.
void main()
{
int *i;
float j;
j = (float)i; /* cannot cast from
pointer to int to float */
}
'conversion' : cannot convert from 'type1' to 'type2'
The compiler was unable to cast from ‘type1’ to ‘type2.’ If you’ve encountered this error on code which compiled with an earlier version of Visual C++, please read Technote: Improved Conformance to ANSI C++ for more information.
The following example illustrates this error.
void main()
{
int *i;
float j;
j = (float)i; /* cannot cast from
pointer to int to float */
}
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询