摘要:
链表与数组的异同: 1、数组中的元素在内存中是连续的; 链表不是. 2、数组的内存是一次性分配和释放的; 链表不是. 3、链表定位元素是顺藤摸瓜; 数组是一步到位, 更快. 4、链表可以方便的插入和删除元素; 用数组实现即麻烦有费时, 基本没人这样做. 5、链表拥有更多扩展的潜力! 阅读全文
posted @ 2009-01-09 11:05
东睿
阅读(201)
评论(0)
推荐(0)
摘要:
本例效果图: unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls; type TForm1 = class(TForm) Memo1: TMemo; Button1: TButton; Button2:... 阅读全文
posted @ 2009-01-09 10:59
东睿
阅读(263)
评论(0)
推荐(0)
摘要:
如果在结构中再拿出 4 个字节的地址空间指向上一个节点, 就成了双向链表了. 本例效果图: unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls; type TForm1 = class(TForm... 阅读全文
posted @ 2009-01-09 10:55
东睿
阅读(316)
评论(0)
推荐(0)
摘要:
procedure TForm1.FormCreate(Sender: TObject); var Str: string; pStr: PString; begin Str := 'Delphi 2007'; pStr := @Str; {用 @ 获取指针} ShowMessage(pStr^); {Delphi 2007} Str := 'Delphi 2... 阅读全文
posted @ 2009-01-09 10:46
东睿
阅读(565)
评论(0)
推荐(0)
摘要:
//分割字符串 ExtractStrings var s: String; List: TStringList; begin s := 'about: #delphi; #pascal, programming'; List := TStringList.Create; ExtractStrings([';',',',':'],['#',' '],PChar(s),List);... 阅读全文
posted @ 2009-01-09 10:36
东睿
阅读(226)
评论(0)
推荐(0)
摘要:
尽管使用 TIniFile 类很方便, 但我觉得还是用系统 API 操作更顺手, 读写各只需要一行代码, 也不用 uses IniFiles. 本例效果图: 代码文件: unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dia... 阅读全文
posted @ 2009-01-09 10:25
东睿
阅读(622)
评论(0)
推荐(0)

浙公网安备 33010602011771号