Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void pesquisarCliente()
- {
- system("cls");
- char temp[50];
- char tempIdade[50];
- char tempSalario[50];
- char pesquisa[50];
- printf("________________________________________________________________________________");
- printf("\nDigite o nome do cliente: ");
- fflush(stdin);
- gets(pesquisa);
- FILE *f;
- f=fopen("banco.txt","r");
- while(fscanf(f,"%s",temp)!=EOF)
- {
- if(strcmp(temp,pesquisa)==0)
- {
- printf("\nCliente encontrado!\n\n");
- printf("\nNome %s",temp);
- fscanf(f,"%s",tempIdade);
- printf("\nIdade: %s",tempIdade);
- fscanf(f,"%s",temp);
- printf("\nSexo: %s",temp);
- fscanf(f,"%s",tempSalario);
- printf("\nSalario: %s",tempSalario);
- fscanf(f,"%s",temp);
- printf("\nDepartamento: %s\n\n",temp);
- system("pause");
- }
- }
- fclose(f);
- system("cls");
- main();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement