Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int main()
- {
- // r read ; w = write ; a = append mode
- FILE *inputFile;
- inputFile = fopen("input.txt" , "r");
- if(inputFile == NULL){
- printf("File not found");
- return 0;
- }
- FILE *outputFile;
- outputFile = fopen("output.txt" , "w");
- while(1){
- char ch = fgetc(inputFile);
- if(ch == EOF){
- break;
- }
- fputc(ch , outputFile);
- }
- //Use log file for seeing history:
- FILE *logFile;
- logFile = fopen("output.txt" , "a");
- fprintf(logFile , "found at 9.05 pm\n");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement