Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- using namespace std;
- int main() {
- FILE *source, *dest;
- char dir_source[20], dir_dest[20];
- printf("Example of file path: C:\\file.txt\n");
- printf("Enter source file path\n");
- scanf("%s", dir_source);
- printf("Enter destination file path\n");
- scanf("%s", dir_dest);
- source = fopen(dir_source, "r");
- dest = fopen(dir_dest, "w");
- while (!feof(source))
- {
- char ch = getc(source);
- if (ch == '\n' or ch == EOF) continue;
- putc(ch, dest);
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement