C C 例項 通訊錄管理系統

2021-10-09 13:55:02 字數 1108 閱讀 5835

using

namespace std;

#include

#include

struct contacter

;//尋找聯絡人末尾位置,找到當前第乙個空聯絡人的位置

void

find_end

(contacter* p,

int*p1)

*p1 = i;

}//新增聯絡人函式

void

addcontacter

(contacter* p,

int*p1)

//顯示聯絡人函式:輸出所有聯絡人資訊

void

show_contacts

(struct contacter *p,

int*p1)

}//刪除聯絡人函式

void

delete_contacter

(struct contacter* p,

int*p1)

*p1 =

*p1 -1;

break;}

}}//查詢聯絡人函式

void

find_contacter

(contacter* p,

int*p1)}if

(k ==

*p1)

}//修改聯絡人函式

void

modify_contacter

(struct contacter* p,

int*p1)}if

(k ==

*p1)

else

}//清空聯絡人函式

void

empty_contacters

(struct contacter* p,

int* p1)

*p1 =0;

}//初始化年齡(0)

void

initial_age

(contacter* p)

}int

main()

} theend:cout <<

"再見!"

<< endl;

return0;

}

通訊錄管理系統

include include include using namespace std const char ptxt e phone.txt const char pctxt e phonecard.txt 將文字位置設為常變數 class phonecard 手機卡類 void set stri...

通訊錄管理系統

在這裡插入 片通訊錄管理系統 include include include 在顯示聯絡人處的性別運用了三目運算子 define max 1000 using namespace std void showmenu 函式定義 返回值型別 函式名 引數列表 例 int add int num1,int...

C 通訊錄管理系統

總結一下自己的查漏補缺 1 while裡面利用乙個return 0 可以終止無限迴圈 2 主函式裡面的函式呼叫自定義函式傳入的引數用 取出位址,但是定義函式的時候利用 去接收 傳過來的位址。我之前一直弄錯。3 此類裡面利用結構體巢狀。通訊錄有很多人,每個人有名字,年齡等 因此首先定義乙個結構體儲存個...