您的位置:首页 > 编程语言 > PHP开发

OutputDebugString下遇见了LPCSTR与char *str之间的关系

2014-04-21 00:01 471 查看
CCC.h

#pragma once

#include <windows.h>

typedef LPCSTR XXX;

class CCC
{
public:
void OPSID(XXX lpstr1,XXX lpstr2)
{
OutputDebugString(lpstr1);
OutputDebugString(lpstr2);
}
protected:
private:
};


DDD.h

#pragma once

#include <windows.h>

typedef const char *xLPCSTR,*xPCSTR;

class DDD
{
public:
void OPSID(xLPCSTR lpstr1,xLPCSTR lpstr2)
{
OutputDebugString(lpstr1);
OutputDebugString(lpstr2);
}
protected:
private:
};


应用以上代码

  char strArray[256]="12313";
CCC *pccc;
pccc=new CCC();
pccc->OPSID("",strArray);

DDD ddd;
ddd.OPSID(strArray,strArray);


LPCSTR 、 const char * 、怎么输出字符串到缓冲区 、printf(char*,const char* ......)

所有的事实都在说明const char * 能干的事情一目了然
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: