【发布时间】:2019-11-28 21:00:25
【问题描述】:
我需要将一个文件的内容复制到另一个文件并在屏幕上打印另一个文件的内容。
程序创建文件并复制内容没有问题,但它不会在屏幕上打印任何内容。
感谢您的宝贵时间。
void organizeContent(FILE *file) {
FILE *file_student = fopen("student.txt", "w+");
int ch;
while((ch = fgetc(file)) != EOF)
fputc(ch, file_student);
fflush(file_student);
int ch2;
while((ch2 = fgetc(file_student)) != EOF) {
fputc(ch2, stdout);
return;
}
【问题讨论】: