1、
#include <stdio.h> #include <ctype.h> int main(void) { int ch; FILE *sfp; FILE *dfp; char sfile[FILENAME_MAX]; char dfile[FILENAME_MAX]; printf("sfile name: "); scanf("%s", sfile); printf("dfile name: "); scanf("%s", dfile); if((sfp = fopen(sfile, "r")) == NULL) printf("aSfile open failed. "); else { if((dfp = fopen(dfile, "w")) == NULL) printf("aDfile open failed. "); else { while((ch = fgetc(sfp)) != EOF) { putchar(tolower(ch)); fputc(tolower(ch), dfp); } fclose(dfp); } fclose(sfp); } return 0; }