#include <stdlib.h>
void main()
{
FILE *in,*out;
char ch;
if((in=fopen("file1.dat","r+"))==NULL)
{
printf("can,t open thie file!");
exit(0);
}
if((out=fopen("file2.dat","w+"))==NULL)
{
printf("can,t open thie file!");
exit(0);
}
while(!feof(in))
{
ch=fgetc(in);
char ch1=ch+'A'-'a';
fputc(ch1,out);//從infile中取入字符放到outfile文件中去
}
while(!feof(out))
{
ch=fgetc(out);
putchar(ch);
out++;
}
fclose(in);
fclose(out);
}