#include
#include
#include
#define maxword 25
#define maxmean 50
struct
record ;
struct
lnode ;
/* 函式宣告 */
void
add(struct lnode *list)
;
void
search
(struct lnode *list)
;
void
edit
(struct lnode *list)
;
void
delete
(struct lnode *list)
;
void
display
(struct lnode *list)
;
struct lnode *searchprimarykey
(struct lnode *list, char *key)
;
void
insertlist
(struct lnode *list, struct lnode *n)
;
void
freelist
(struct lnode *list)
;
void
displaytablehead
(void)
;
void
displayrecord
(struct lnode *r)
;
void
displaymenu
(void)
;
/* 主程式 */
intmain
(int argc, char *ar**)
function = disp;
/* 頭結點 */
dictionary = (struct lnode *)
malloc(
sizeof(struct lnode));
if(dictionary !=
null)
while(function != exit)
switch(function)
}freelist(dictionary);
}/* 新增 */
void
add(struct lnode *list)
} else
}/* 修改 */
void
edit
(struct lnode *list)
else
}/* 查詢 */
void
search
(struct lnode *list)
else
}/* 刪除 */
void
delete
(struct lnode *list)
q = p;
p = p->next;}}
/* 顯示所有記錄 */
void
display
(struct lnode *list)
printf(
"\n--------- total: %d record(s) ---------\n",c);
}/* 按主鍵查詢 */
struct lnode *searchprimarykey
(struct lnode *list, char *key)
p = p->next;
}return
null;
}/* 將記錄按姓名字母公升序插入鍊錶 */
void
insertlist
(struct lnode *list, struct lnode *n)
n->next = p->next;
p->next = n;
}/* 釋放整個鍊錶空間 */
void
freelist
(struct lnode *list)
free(p);
}/* 顯示表頭 */
void
displaytablehead
(void)
/* 顯示一條記錄 */
void
displayrecord
(struct lnode *r)
/* 顯示選單 */
void
displaymenu
(void)
c語言日誌功能實現
include include include include ifdef win32 include else include linux下標頭檔案 endif define file max size 1024 1024 獲得當前時間字串 param buffer out 時間字串 return...
英漢詞典(C語言)
1 include txt 文件見檔案末 2 include 3 include 4 include 5 define n 1000 6 typedef struct word 7 word 11void search word s,int num,char d 查詢12 void revise w...
C語言 用C語言實現快速排序
快速排序時間複雜度為o nlogn 是陣列相關的題目當中經常會用到的演算法。在c語言中,陣列作為引數傳遞時會轉換為指向陣列起始位址的指標,非陣列形式的資料實參均以傳值形式呼叫。下列兩種形式的傳參時等價的,他們均指向陣列a的初始位址。void test int a void test int a 因此...