+ 3
What will happen if I don't call fclose() in C program?
Just to know for curiosity 😅. Will it be harmful to program or the file will not be accessed again?
4 Respuestas
+ 8
Suyash ,
If an open file is not closed correctly, this can, in the worst case, lead to the total loss of the entire file content. however, this varies depending on the operating system.
▪︎when a file was not closed correctly before the program is terminated normally, the operating system will try to close the file. In many cases this can prevent a data loss.
▪︎when a file was not closed correctly, and the programm is terminated unexpectedly by a crash, the loss of data can hardly be prevented.
+ 3
If you neglect to close a shared file in a multi-user environment you will have great fun watching users throw up their hands, break office equipment, and express much anger at your software.
0
It is harmful to program due to a dynamic memory leak