How to create a temporary text file in C++?

后端 未结 7 1300
北荒
北荒 2020-12-09 08:30

I\'m trying to create a temporary text file in C++ and then delete it at the end of the program. I haven\'t had much luck with Google.

Could you tell me which funct

7条回答
  •  感情败类
    2020-12-09 09:22

    I wonder why most of you guys showed him the C way of doing it instead of the C++ way.
    Here's fstream.
    Try that, deleting a file is OS depended but you can use boost.filesystem to make things easy for you.

提交回复
热议问题