Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int main(int argc, char ** argv) {
- if (argc < 2) {
- perror("Too few arguments\n");
- return FUN_FAILLURE;
- }
- FILE *src = fopen(argv[1],"r");
- if (src == NULL) {
- perror("Error : source file\n");
- return FUN_FAILLURE;
- }
- FILE *dest = fopen("test.txt", "w");
- if (dest == NULL) {
- perror("Error : destination file\n");
- return FUN_FAILLURE;
- }
- char *p;
- int rr = fgetc(src);
- while (rr != EOF) {
- fwrite(p, sizeof(char), 1, dest);
- }
- return FUN_SUCCESS;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement