基於單鏈表實現的簡單通訊錄

2021-10-05 09:59:51 字數 1561 閱讀 3933

#include

#include

#include

#pragma warning(disable:4996);

//解決vs報嚴重性**錯誤

typedef

struct lnode

linknode;

//建立通訊錄

lnode*

createlist

(lnode*

& l)

r->next =

null

;return l;

}//新增聯絡人

void

listinsert

(lnode*

& l)

new_s =

(lnode*

)malloc

(sizeof

(lnode));

printf()

;scanf

("%s%lf"

,&new_s->name,

&new_s->ph_number)

;printf

("\n");

r->next = new_s;

r = new_s;

r->next =

null;}

//查詢聯絡人

bool locate

(lnode*

& l)

if(p ==

null

)return false;

else

return true;

}//修改聯絡人

bool modifylist

(lnode*

& l)

if(p ==

null

)return false;

else

}//刪除聯絡人

bool listdelete

(lnode*

& l)

if(p ==

null

)return false;

else

}//載入通訊錄

void

displist

(lnode* l)

}int

main()

else

case3:

if(modifylist

(l)==1)

else

case4:

if(listdelete

(l)==1)

else

case5:

displist

(l);

break

;default

:printf

("error!!!\n");

}}return0;

}

執行截圖

單鏈表實現通訊錄

main.c include include addresslist.h int main addresslist.c include include addresslist.h include int g id 10000 list createlist ls head next null 空鍊錶...

單鏈表通訊錄 通訊錄2 0

單鏈表通訊錄 通訊錄2.0 標頭檔案 ifndef address h define address h include include include define success 10000 define failure 10001 define true 10002 define false ...

單鏈表寫通訊錄

單鏈表實現通訊錄,增加,刪除,更改乙個聯絡人等功能。其中增加了乙個記憶體池功能,用於對廢棄記憶體的 和利用。include include include define max 1024 void addperson struct presonlist node 新增乙個聯絡人 void displ...