⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 searches.c

📁 linux 软件工程师C语言版,经典linuxC语言编程,诸多案例
💻 C
字号:
#include<stdio.h>
#include<string.h>
#include"phbook.h"
void searches()
{
	char name[20];
	int i,key;
	key=0;
	printf("Whose number do you wanna find:");
	scanf("%s",&name);
	fp = fopen("file1","r");
    fread(s,sizeof(struct test),sumno,fp);
    fclose(fp);
	for(i=0;i<sumno;i++)
		if(strcmp(s[i].name,name)==0)
		{
			printf("The one you wanna find is:\n");
	        printf("%-20s %s\n",s[i].name,s[i].No);
			key++;
		}
	if(key==0)
		printf("The people you find is not in the phoonbook!");
	face();
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -