Advertisement
iskhakovt

C I/O

Sep 19th, 2015
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.34 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. int const MAX_LEN = 1024 * 1024;
  4.  
  5. int main() {
  6.     FILE *fin = fopen("input.txt", "r");
  7.     FILE *fout = fopen("output.txt", "w");
  8.  
  9.     char str[MAX_LEN];
  10.     fgets(str, MAX_LEN, fin);
  11.  
  12.     char ch = fgetc(fin);
  13.  
  14.     fputc(ch, fout);
  15.     fputs(str, fout);
  16.  
  17.     fclose(fin);
  18.     fclose(fout);
  19.  
  20.     return 0;
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement