Crise print.c
From AdonaiMedrado.Pro.Br
Revision as of 21:41, 12 June 2009 by Adonaimedrado (Talk | contribs) (New page: <code lang="c"> #include <stdio.h> struct folha { char servidor[51]; int idade; int salario; }; int main(void) { FILE *fp = fopen("crise.dat","r"); struct folha fl; while (fread...)
#include <stdio.h> struct folha { char servidor[51]; int idade; int salario; }; int main(void) { FILE *fp = fopen("crise.dat","r"); struct folha fl; while (fread(&fl,sizeof(struct folha),1,fp)>0) printf("Servidor: %s, Idade: %d, Salario: %d\n", fl.servidor, fl.idade, fl.salario); fclose(fp); return 0; }