fork(2) download
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. void head(FILE*);
  5.  
  6.  
  7. void main()
  8. {
  9. int i;
  10. FILE *f;
  11.  
  12. f = fopen("000.txt", "w");
  13.  
  14. i = 0;
  15. while (i++ < 256)
  16. {
  17. // Какие-то действия
  18.  
  19. // Обязательно через ф-ю
  20. head(f);
  21. // Какие-то действия
  22. }
  23.  
  24. fclose(f);
  25. }
  26.  
  27.  
  28. void head(FILE *f)
  29. {
  30. // Какие-то действия
  31. fprintf(f, "\n");
  32. // Какие-то действия
  33. }
Runtime error #stdin #stdout 0s 2376KB
stdin
Standard input is empty
stdout
Standard output is empty