全國最多中醫師線上諮詢網站-台灣中醫網
發文 回覆 瀏覽次數:1194
推到 Plurk!
推到 Facebook!

linker list 的資料結構

尚未結案
bhead811
一般會員


發表:13
回覆:18
積分:6
註冊:2003-05-29

發送簡訊給我
#1 引用回覆 回覆 發表時間:2003-06-19 23:02:44 IP:61.64.xxx.xxx 未訂閱
dear all: 我有一個問題,我想了好久,但就是不知道如何下手,..... 就是當在記憶體內有一個linker list 的資料結構,其資料結構我也知道,我要 如何寫一個function去接受這個linker list 的資料結構,是要傳pointer 嗎? 在function內要如何去解析這個資料結構.
timhuang
尊榮會員


發表:78
回覆:1815
積分:1608
註冊:2002-07-15

發送簡訊給我
#2 引用回覆 回覆 發表時間:2003-06-20 10:53:42 IP:203.95.xxx.xxx 未訂閱
請問你是用 TList 嗎, 還是自己寫的 link list??
bhead811
一般會員


發表:13
回覆:18
積分:6
註冊:2003-05-29

發送簡訊給我
#3 引用回覆 回覆 發表時間:2003-06-20 11:34:32 IP:61.220.xxx.xxx 未訂閱
引言: 請問你是用 TList 嗎, 還是自己寫的 link list??
是自定的link list,因為我現在要用delphi寫一個dll的function,準備要給vc 來呼叫,vc 會傳一個link list 的pointer給我的function; 我現在就不知道要如何宣告一個可以接pointer 的function,及function內要如何處理這個收到的linker list 的資料結構.可不可以給我一個方向或架構呢?
pgdennis
資深會員


發表:41
回覆:526
積分:443
註冊:2002-05-23

發送簡訊給我
#4 引用回覆 回覆 發表時間:2003-06-20 12:30:48 IP:218.163.xxx.xxx 未訂閱
http://www.google.com.tw/search?q=cache:CHohQxBk-0EJ:delphi.about.com/library/weekly/aa011601a.htm+delphi++structure++linked++list&hl=zh-TW&ie=UTF-8&inlang=zh-TW 有講一點  
Pointers to records
When we define a record or other data type, it's a common practice 
also to define a pointer to that type. This makes it easy to 
manipulate instances of the type without copying large blocks of memory. In fact, any data type that requires large, dynamically allocated blocks of memory uses pointers.     The ability to have pointers to records (and arrays) makes it much
 more easier to set up complicated data structures as linked lists 
and trees. What follows is an example of the type declaration for a simple linked list:     type
  pNextItem = ^LinkedListItem
  LinkedListItem = record
    sName    : String;
    iValue   : Integer;
    NextItem : pNextItem;
end;
The idea behind linked lists is to give us the possibility to store 
the address to the next linked item in a list inside a NextItem record field. For more on data structures consider the book: 
"The Tomes of Delphi: Algorithms and Data Structures". 
 
永遠追不上技術更新的速度~~
------
星期一,二...無窮迴圈@@
bhead811
一般會員


發表:13
回覆:18
積分:6
註冊:2003-05-29

發送簡訊給我
#5 引用回覆 回覆 發表時間:2003-06-20 14:24:50 IP:61.220.xxx.xxx 未訂閱
謝謝您的回應,我想我應該找到方向了!        
系統時間:2024-05-20 11:09:48
聯絡我們 | Delphi K.Top討論版
本站聲明
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。
2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。
3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇!