以下代碼給出了段錯誤....爲什麼?事件嘗試與fputcputc給出分段錯誤?
我想可能有一個愚蠢的錯誤,我無法得到..但沒有ENOGH時間。
請幫助...
#include <stdio.h>
int main() {
// system("sudo openssl enc -base64 -in file.txt -out file.txt.enc");
FILE *fp,*fq;
char ch;
fp = fopen("file.txt.enc","r");
fq = fopen("output.txt","w");
while((ch=fgetc(fp)) != EOF)
putc(ch,fq);
return 0;
}
確保'fopen'工作並沒有返回NULL指針。完成後還要附帶'fclose'。 – Joe
我想這是第20次看到相同的問題 – niko
正常工作我的編譯器我沒有問題 – niko