Difference between fclose and close

后端 未结 4 1744
终归单人心
终归单人心 2020-12-31 14:50

If I fopen a file, what\'s the difference between calling fclose or close and which one should I use?

If forked children have

4条回答
  •  误落风尘
    2020-12-31 15:20

    which one should I use?

    If you open a file with fopen, close it with fclose. Using close in this case may cause a memory leak on a handle allocated by fopen

提交回复
热议问题