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

📄 print.c

📁 A simple bibliotech archive coded in C. A real exercise with fopen write and the other base functio
💻 C
字号:
#include "head.h"int  load(char *nomefile,struct libro v[]){ FILE *f; int k=0,i=0; if((f=fopen(nomefile,"r"))==NULL){ fprintf(stdout,"[*] I can't load the database file [*]\n");                                    return -1;                                  } while (fscanf(f,"%s%s%s%d%f\n",v[k].titolo,v[k].autori,&v[k].editore,&v[k].num_pagine,&v[k].costo) !=EOF) k++; fflush(f); fclose(f); return 0;}int main(int argc,char *argv[]){ char *risp;int i,min,max;if (load(argv[1],books)==-1) return -1;fprintf (stdout,"[*] Load the database %s file [*]\n",argv[1]);for (i=atoi(argv[2]);i<atoi(argv[3]);i++){ if (books[i].titolo    !='\0' &&      books[i].autori    !='\0' &&     books[i].editore    !='\0' &&      books[i].num_pagine !='\0' &&     books[i].costo!= '\0' ) printf (" %d :%s %s %s %d %f\n",i, books[i].titolo,books[i].autori,books[i].editore,books[i].num_pagine,books[i].costo);else  fprintf (stdout,"%d :   -=Free=-   \n",i);}return 0;}

⌨️ 快捷键说明

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