Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想创建一个临时文件流。是否有与 C 的 tmpfile() 函数等效的 c++。
如果没有,我将如何创建一个?
你可能想看看这个。
您可以检查您的实现是否提供了一个std::fstream采用文件描述符的构造函数,如果是,则使用fileno从FILE*返回的tmpfile(). 但是 C++ 标准并不能保证构造函数。
std::fstream
fileno
FILE*
tmpfile()