Difference between revisions of "Crise print.c"

From AdonaiMedrado.Pro.Br
Jump to: navigation, search
(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...)
 
(No difference)

Latest revision as of 21:41, 12 June 2009

#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;
}