#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