#include<stdio.h>
#include<ctype.h>
int main() {
FILE *fpin = fopen("in.txt", "r");
fprintf(fpin, "hello, world!");
fclose (fpin);
char c;
fpin = fopen("in.txt", "r");
FILE *fpout = fopen("out.txt", "w");
while ((c = fgetc(fpin)) != EOF) {
fputc (toupper(c), fpout);
}
fclose (fpout);
fclose (fpin);
return 0;
}
我得到一个写这个文件句柄有什么问题?
分段故障
谢谢。
学会使用调试器 – pm100 2010-10-12 17:54:54