cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
Beginners
fopen(): Get file streams automatically
fopen(): Get file streams automatically closed when a program ends?
Oct 25, 2020 at 9:34pm UTC
nuderobmonkey
(640)
If I have opened a file with fopen(), need I then close the file before the program exits, or will it automatically get closed?
Last edited on
Oct 25, 2020 at 9:35pm UTC
Oct 25, 2020 at 9:47pm UTC
nuderobmonkey
(640)
After a further search (previously I found nothing about that topic) I found this on stackoverflow:
https://stackoverflow.com/questions/8175827/what-happens-if-i-dont-call-fclose-in-a-c-program
So yes, by normal program exit all files get automatically closed.
Topic archived. No new replies allowed.