Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- int main (int argc, char * argv[]) // taking files
- {
- FILE * fp;
- FILE * fp2;
- int c;
- .
- . // checking possible problems
- .
- while ( (c = fgetc(fp)) != EOF){ // copying one file to another one
- fputc (c, stdout);
- fputc (c, fp2);
- }
- fclose(fp);
- fclose(fp2);
- fp = NULL;
- fp2 = NULL;
- return EXIT_SUCCESS;
- }
- char buffer[4096];
- while (fgets(buffer, sizeof(buffer), fp) != 0)
- {
- fputs(buffer, stdout);
- fputs(buffer, fp2);
- }
Add Comment
Please, Sign In to add comment