Advertisement
Guest User

Untitled

a guest
Nov 17th, 2019
170
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.08 KB | None | 0 0
  1. //* CARGAR A ARCHIVO NO ATENDIDOS *//
  2.     void cargar_arch_noaten(listaP P){
  3.     FILE *fp;
  4.     fp = fopen("noatendidos.txt","a+");
  5.     if(fp == NULL){
  6.         printf("No se pudo abrir el archivo\n");
  7.  
  8.  
  9.     } else
  10.     if(emptyP(P)==1){
  11.     printf("Lista Vacia\n");
  12.     }
  13.     else {
  14.     int i=0;
  15.  
  16.     resetP(&P);
  17.     char separacion[] = "******************************************";
  18.     while(oosP(P)==0){
  19.     if(mostrar_solo_hora_aten(copyP(P))==24){
  20.     fprintf(fp,"%s\n",separacion);
  21.     fprintf(fp,"Nombre y Apellido: %s %s\n", mostrar_nom(copyP(P)),mostrar_ape(copyP(P)));
  22.     fprintf(fp, "Edad: %d\n", mostrar_edad(copyP(P)));
  23.     fprintf(fp, "DNI: %d\n", mostrar_dni(copyP(P)));
  24.     fprintf(fp, "Hora de ingreso: %d Hs %d Min\n", mostrar_ingreso(copyP(P)).hora, mostrar_ingreso(copyP(P)).minuto);
  25.     i++;
  26.     }
  27.  
  28.     forwardP(&P);
  29.  
  30.     }
  31.         if(i==0){
  32.     printf("No se encontraron pacientes NO ATENDIDOS para insertar en el archivo.\n");
  33.     }
  34.     else {
  35.     printf("Se insertaron %d pacientes NO ATENDIDOS al archivo\n",i);
  36.  
  37.     }
  38.     }
  39.     fclose(fp);
  40.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement