|
#include<stdio.h>
main( )
{
char in_name[25], out_name[25];
FILE *in_file, *out_file;
int c;
in_file = fopen("data.tc", "r");
if(in_file == NULL)
printf ("could not open %s for reading \n", in_name);
else
out_file = fopen ("result.tc","w");
if (out_file == NULL)
printf ("could not open file for writing");
while ((c = getc (in_file)) != EOF)
putc (c,out_file);
printf ("file has been copied \n");
getch();
}
|
|
| Use of fget c and fput functions to make a copy of a text file junk to terminate the program enters a blank line. |
|
| |
|
|
|
|