문제

  if(RS_ile==1) 
  { 
     if(RS_buf == 1)   break; 
     if(RS_buf==49)
     printf("1\n");
     else
     {

     printf("%d\n", RS_buf); 
     fprintf (fp, "%d\n", RS_buf);
      fclose (fp);
     }  
  } 

Everything work fine but all data was saved after I close my program. All I need is to put date to file while program is running not after closed.

Operating system Windows 8.1

도움이 되었습니까?

해결책

Put a fflush(fp) ; after your fprintf.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top