如何把指针类型转化为字符串 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)); ..类似 猴王问题的公式分析 请教一个变长结构的定义和使用 sql语句的内连接,外连接,左连接,右连接问题,我晕死了,请指点呀? D7中怎样将int转换成Numeric? 关于 WriteFile 有点难的问题? 如何调用word 如何判断某个form是否已经create? DELPHI如何运用“系统的一些操作” delphi的unit的字体能否更改? 请问@是什么符号?有什么作用? 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));
..类似