Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- void read(char* readFileName,char*writeFileName)
- {
- FILE* READ = fopen(readFileName, "r");
- FILE* WRITE = fopen(writeFileName, "w");
- char line[256];
- if (WRITE == NULL || READ == NULL)
- {
- printf("Error opening file!\n");
- exit(1);
- }
- while (fgets(line, sizeof(line), READ)) {
- fprintf(WRITE, "%s", line);
- }
- fclose(READ);
- fclose(WRITE);
- }
- int main()
- {
- char* finput ="yara.txt" ;
- char* foutput="output.txt";
- read(finput,foutput);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement