只是尝试写入文件,程序正在创建文件,但信息实际上并没有写入文件。什么是传递不是问题!
void writetofile (double *A, double *B, double *C, double *D, int N)
{
int i;
for (i = 0; i <= N; i++)
{
FILE * filePtr = fopen("Output.txt", "w");
if (filePtr == NULL)
{
printf("File not found\n");
exit(1);
}
// This must be where my problem is..
fprintf(filePtr, "%f %f %f %f\n", A[i], B[i], C[i], D[i]);
}
}