要求:编写程序,从文本文件中读取全部内容,并复制到另一个文件中。
要求将文本文件中的所有英文字母都转换成大写后输出。
我这个为什么错了啊,说是不能打开文件?
#include<stdio.h>
#include<ctype.h>
#include<process.h>
int main()
{
char ch;
FILE *fp1,*fp2;
if((fp1=fopen("C:\\TC\\BIN\\w.txt","r"))!=NULL)
{printf("File open error!\n");exit(0);}
if((fp2=fopen("C:\\TC\\BIN\\www.txt","w"))!=NULL)
{printf("File open error!\n");exit(0);}
while((ch=fgetc(fp1))!=EOF)
{
fputc(ch,fp2);
isalpha(ch);
islower(ch);
}
fclose(fp1);
fclose(fp2);
return 0;}
还是不行^