C手机通讯录课程设计报告书 - 百度文库 ϵͷ

ʱ : C手机通讯录课程设计报告书 - 百度文库ϿʼĶ

}

case 1: }

if(p==NULL) } }

cout<<\ɾϵ˲ڣ\<

cout<<\\<

if(strcmp((p->data).name,nam)==0) { } else {

while(p!=NULL) {

if(strcmp((p->data).name,nam)==0) { }

q->next=p->next;

cout<<\ɾɹ\<

first->next=p->next; cout<<\ɾɹ\<

q=p; p=p->next; }

case 2: default:

template

void Telebook :: printdata()//¼ {

Node *p=first; first->next=NULL;

ifstream infile(\,ios::in); if(!infile) { }

string ph,ma;

char nam[10],addr[20];

while(infile.good())//жļǷ񱻶 { }

infile.close();

Node *t=first->next; cout<

cout<<\cout<<\;

cout<

cout<

cout<data).name<<\<data).address<<\

<data).phone<<\<data).mail<<\infile>>nam>>addr>>ph>>ma; DataType a(nam,addr,ph,ma);

Node *s=new Node ; s->data=a; p->next=s; s->next=NULL; p=s;

cout<<\ϵʧܣ\<

------\<

\<

\<

t=t->next;

cout<<\}

------\<

}

template

void Telebook :: save()//浽ļ { }

Դļmain.cpp:

#include #include%using namespace std; void main() {

bool flag=true;

Node *p =first->next; ofstream outfile(\,ios::out); if(!outfile) { } int i=0; while(p!=NULL) {

if(p->next==NULL) }

outfile.close();

{ } else { } p=p->next;

outfile<<(p->data).name<<\<<(p->data).address<<\<<(p->data).phone<<\<<(p->data).mail<data).name<<\<<(p->data).address<<\

<<(p->data).phone<<\<<(p->data).mail;//һӦûУ //¼ʱһ break;

cout<<\ϵ˱ʧܣ\<

Telebook telebook;//޲ι캯 telebook.main_menu(); while(flag){

int t;

cout<<\ѡѡ(0-8)[˵]\; if(cin>>t){}//쳣 else { }

switch(t) { case 1:

telebook.main_menu(); break;

telebook.add(); telebook.save(); break;

telebook.delet(); telebook.save(); break;

telebook.printdata(); break;

telebook.set(); telebook.save(); break;

telebook.lenth(); break;

telebook.search(); break;

cout<<\\<

case 2:

case 3:

case 4:

case 5:

case 6:

case 7: