Delphi结构体指针的使用


本文整理自网络,侵删。

 
一段简单的代码就可以看明白它的用法:


type
   rSMS = record //定义结构体
    iSMSStore: integer;
    iSMSIndex: integer;
  end;
  PSMS = ^rSMS; //定义结构体指针
 
...省略
 
var
    SMSPointer: PSMS;
begin
    New(SMSPointer);//申请
    SMSPointer^.iSMSStore := 12;//赋值,Delphi允许省略^
    SMSPointer^.iSMSIndex := 12;
    //..对结构体指针的应用
    Dispose(SMSPointer);//释放
end;

相关阅读 >>

Delphi tstringlist 保存txt文本文件最后一行不留空行

Delphi屏蔽指定热键

Delphi 设置系统静音取消系统静音

Delphi xe 使用savestate保存firemonkey状态的示例

Delphi listbox防止添加重复

Delphi中如何用image控件显示网络图片

Delphi 实现php的urlencode编码效果

Delphi idhttp的用法

Delphi tdirectory.tfilterpredicate

Delphi closefile 关闭文件

更多相关阅读请进入《Delphi》频道 >>



打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...