#include <stdio.h>
#include <stdlib.h>
int main() {
int c;
FILE *poem = fopen("short.txt", "r");
FILE *html = fopen("index.html", "w");
if (poem == NULL){
perror("Error in opening file");
return(-1);
}
if (html == NULL){
perror("Error in opening file");
return(-1);
}
while((c = fgetc(poem)) != EOF) {
c = getc(poem);
fputc(c, html);
}
fclose (poem);
fclose (html);
return 0;
}
我一直在寻找和尝试,但我无法弄清楚。我的阅读文件不到一个单词的句子,然后当它输出到index.html
这一切都混乱起来。我真的不明白知道代码有什么问题。任何帮助将不胜感激。谢谢!我的文本输出文件是不一样的输入
混乱了,或每第二个字符? – 2014-09-06 20:45:30