Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- int main()
- {
- FILE *fp_in, *fp_out;
- int ch, count=0;
- fp_in = fopen("apon.jpg", "rb");
- if(fp_in == NULL)
- {
- perror("File opening failed");
- return EXIT_FAILURE;
- }
- fp_out = fopen("apon1.jpg", "wb");
- while(1)
- {
- ch = fgetc(fp_in);
- count++;
- if(ch == EOF){
- break;
- }
- fputc(ch, fp_out);
- }
- printf("%d\n", count);
- fclose(fp_in);
- fclose(fp_out);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement