如何把指针类型转化为字符串 as title 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 function StrPas(const Str: PChar): string; 是呀 string(p) 就可以如果是其他类型的 指针 可能还需要这样string(PChar(p)); //p 非PChar类型指针 pChar-->string,可以不转换. 这个我们可以从strPas()的源看出.function StrPas(const Str: PChar): string;begin Result := Str;end;pByte-->string:pChar(pointer(B:pByte)).先将pByte转成pChar,再转成string;-->推广: 指针类型的互转:要转的类型(pointer(原来的类型)); pByte->pInteger:pInteger(pointer(pByte)); pInteger->pChar:pChar(pointer(pInteger)); ..类似 遇到一个问题 三层读取数据时采用多线程的问题。 如何获取表中字段的类型? 不买日货的最根本理由,一定要看绝对精彩 关于邮件服务器 NMSMTP 组件的发送密码验证问题,请大虾帮我,紧急!!!谢谢! 散分呀!急!后天要交的!!关于2000下用delphi实现拨号的问题! 关于查询最新记录的问题 关于mysql 连接丢失的问题! 请问怎么使用MSDN???? 如果客户机没odbc,怎么用delphi开发的基于odbc的数据库? cxGrid中的一个cxgridtableview,如何根据坐标(x,y)来获取这个位置所在的行? 各位大哥,如何把剪贴版中的图片保存为文件啊?
如果是其他类型的 指针 可能还需要这样string(PChar(p)); //p 非PChar类型指针
这个我们可以从strPas()的源看出.
function StrPas(const Str: PChar): string;
begin
Result := Str;
end;pByte-->string:pChar(pointer(B:pByte)).先将pByte转成pChar,再转成string;-->推广:
指针类型的互转:要转的类型(pointer(原来的类型));
pByte->pInteger:pInteger(pointer(pByte));
pInteger->pChar:pChar(pointer(pInteger));
..类似