i started to make a program to copy contents from one file to another charcter by character. i made the prog but it is not working..
can u plz tell me the error in the code..?
my code is
Expand|Select|Wrap|Line Numbers
- #include <stdio.h>
- main()
- {
- char a;
- FILE *fi, *fo;
- fi= fopen ("sohil", "r");
- fo= fopen ("ab.c", "w");
- while (1)
- {
- fscanf (fi, "&c", &a);
- if (a==EOF)
- {
- break;
- }
- else
- {
- fprintf (fo, "%c", a);
- }
- }
- fclose (fi);
- fclose (fo);
- }