每当我在最后运行我的程序fclose(outputFile);
时,都会出现错误。glibc 检测到...损坏的双链表
不过,令人困惑的是,我在它的fclose(inputFile);
正上方,它工作正常。有什么建议么?
FILE* inputFile = fopen(fileName, "r");
if (inputFile == NULL)
{
printf("inputFile did not open correctly.\n");
exit(0);
}
FILE* outputFile = fopen("output.txt", "wb");
if (outputFile == NULL)
{
printf("outputFile did not open correctly.\n");
exit(0);
}
/* ... read in inputFile ... */
/* ... some fprintf's to outputFile ... */
fclose(inputFile);
fclose(outputFile);