fork download
  1. #include <stdio.h>
  2. #include <io.h>
  3. #include <string.h>
  4.  
  5.  
  6. int main(void){
  7. FILE *in;
  8. FILE *out;
  9. unsigned int BLOCK_SIZE = 3;
  10. unsigned int block[BLOCK_SIZE];
  11.  
  12. in = fopen("input.txt", "wt");
  13. if(in == NULL){ fputs("File error", stderr); return 1; }
  14.  
  15. out = fopen("output.txt", "wt");
  16. if(out == NULL){ fputs("File error", stderr); return 1; }
  17.  
  18. while(!feof(in)){
  19. memset(block, 0, sizeof(block)); //Îáíóëÿåì áëîê
  20. int i = 0;
  21. for(i = 0; i < BLOCK_SIZE; i++)
  22. block[i] = fgetc(in);
  23. //Âûâîäèì áëîê â ôàéë out
  24. fwrite(block, sizeof(block), BLOCK_SIZE, out);
  25. }
  26.  
  27. fclose(in);
  28. fclose(out);
  29. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp:2:16: fatal error: io.h: No such file or directory
 #include <io.h>
                ^
compilation terminated.
stdout
Standard output is empty