ファイル ポインタの受け渡しに問題があります。関数内にファイル ポインタを持つ関数がある場合、どのように渡すのですか (私のコードでは void writequest)? void writequest を入れる前は機能していました。プログラム自体は、映画の名前で満たされた 1 つのファイルから読み取り、別のファイルに挿入することになっています。もちろん、私のコードのその他の失敗にも気兼ねなく書き留めておいてください。
void writequest(int no)
{
int i, j, loop_ctrl, destination;
int movement;
char lib[loop_ctrl+1][92];
int write_nr[loop_ctrl], sorting[destination];
char searching[92];
char *c;
FILE *watched;
FILE *temp;
FILE *refrom;
FILE *reto;
FILE *towatch;
if(no==1)
{
printf("No match found.\n");
}
else if(no==0)
{
printf("Do you wish you write them into a file?\n1 - Yes\n0 - No\n");
scanf("%d", &j);
if(j==1)
{
tofile(watched, temp, refrom, reto, destination, loop_ctrl, write_nr, lib, movement);
close(towatch, watched, temp, refrom, reto);
remove("To_watch.txt");
rename("temp.txt", "To_watch.txt");
}
else if(j==0)
{
printf("Alright then\n");
close(towatch, watched, temp, refrom, reto);
}
}
}