初學單鏈條

2021-10-21 02:15:23 字數 1657 閱讀 2576

學完單鏈條頭髮又掉了幾根

用單鏈條做乙個圖書管理系統

#include

#include

#include

struct book

;void

getinput

(struct book *);

void

addbook

(struct book **)

;void

printlibrary

(struct book *);

struct book *

selectbook

(struct book *

,char*)

;void

printbook

(struct book *);

void

releaselibrary

(struct book **)

;void

getinput

(struct book *book)

void

addbook

(struct book *

*library)

else

tail = book;

}void

printlibrary

(struct book *library)

printf

("\n at the bottom \n");

}struct book *

selectbook

(struct book *library,

char

*target)

book = book->next;

}return book;

}void

printbook

(struct book *book)

//列印檢索的圖書

void

releaselibrary

(struct book *

*library)

//釋放動態申請的記憶體

}int

main

(void

)while

(ch !=

'y'&& ch !=

'n');if

(ch ==

'y')

else

}printf

("下面是圖書庫內容\n********************\n");

printlibrary

(library)

;//列印圖書庫部分

while(1

)//查詢書籍部分

while

(ch !=

'y'&& ch !=

'n');if

(ch ==

'y')

else

while

((book =

selectbook

(book->next,target))!=

null);

}}else

}releaselibrary

(&library)

;printf()

;return0;

}

初學單鏈表

初學單鏈表,還有很多不懂的地方,只能先按照課本上慢慢碼程式了,願老天懂得我的心酸。typedef struct node 定義單鏈表結點 slnode void listinitiate slnode head 單鏈表的初始化,並不懂為什麼要有兩個星號 int listlength slnode h...

響應者鏈條

發生觸控事件後,系統佇列 不接收使用者互動 userinteractionenabled no隱藏 hidden yes透明 alpha 0.0 0.01 主視窗會在檢視層次結構中 找到乙個最合適的檢視來處理觸控事件 但是這僅僅是整個事件處理過程的第一步 找到合適的檢視控制項後,就會呼叫檢視控制項的...

響應者鏈條

所謂的響應者鏈條簡單的說 就是一級一級的查詢處理該事件的物件.當查詢到合適的物件,則執行該任務.它的目的 主迴圈捕捉到事件,找到最佳合適處理該事件的響應者 對於ios裝置使用者來說,他們操作裝置的方式主要有三種 觸控螢幕 晃動裝置 通過遙控設施控制裝置。對應的事件型別有以下三種 1 觸屏事件 tou...