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.\n"); else { if((dfp = fopen(dfile, "w")) == NULL) printf("\adfile open failed.\n"); else { while((ch = fgetc(sfp)) != EOF) { putchar(toupper(ch)); fputc(toupper(ch), dfp); } fclose(dfp); } fclose(sfp); } return 0; }