c语言编写通信录

c语言编写通信录,第1张

IplImage cameraImage = NULL;

while ((cameraImage = cvQueryFrame(capture)) != NULL)

{

cvShowImage("Camera",cameraImage);

cvWaitKey(1);

}

//这个是我教材上的,不知道你要的是不这个

#include<stdioh>

#include<stringh>

struct friends_list

{

char name[10];

int age;

char telephone[13];

};

int Count=0;

void new_friend(struct friends_list friends[]);

void search_friend(struct friends_list friends[],char name);

int main(void)

{

int choice;

char name[10];

struct friends_list friends[50];

do

{

printf("通讯录功能选项:1:新建2:查询0:退出\n");

printf("请选择功能:\n");

scanf("%d",&choice);

switch(choice)

{

case 1:new_friend(friends);

break;

case 2:printf("请输入要查找的联系人姓名:");

scanf("%s",name);

search_friend(friends,name);

break;

case 0:break;

}

}

while(choice!=0);

printf("谢谢使用通讯录功能!\n");

return 0;

}

void new_friend(struct friends_list friends[])

{

struct friends_list f;

if(Count==50)

{

printf("通讯录已满!\n");

return;

}

printf("请输入新联系人的姓名:");

scanf("%s",fname);

printf("请输入新联系人的年龄:");

scanf("%d",&fage);

printf("请输入新联系人的联系电话:");

scanf("%s",ftelephone);

friends[Count]=f;

Count++;

}

void search_friend(struct friends_list friends[],char name)

{

int i,flag=0;

if(Count==0)

{

printf("通讯录是空的!\n");

return;

}

for(i=0;i<Count;i++)

if(strcmp(name,friends[i]name)==0)

{

flag=1;

break;

}

if(flag)

{

printf("姓名:%s\t",friends[i]name);

printf("年龄:%d\t",friends[i]age);

printf("电话:%s\n",friends[i]telephone);

}

else

printf("无此联系人!");

}

以上就是关于c语言编写通信录全部的内容,包括:c语言编写通信录、谁能用C语言给我编写一道关于通讯录的程序,需要有单独的界面,完成选择,搜索等步骤,并能永久保存!、C语言程序设计 建立通信录等相关内容解答,如果想了解更多相关内容,可以关注我们,你们的支持是我们更新的动力!

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/zz/9618254.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-04-30
下一篇 2023-04-30

发表评论

登录后才能评论

评论列表(0条)

保存