Using fopen with temp system variable

后端 未结 2 873
自闭症患者
自闭症患者 2021-01-28 12:45

I had some doubts about fopen...

Can i perform the following?

fopen(\"%temp%\" , \"r\");

or do i need to use windows specific functions

2条回答
  •  爱一瞬间的悲伤
    2021-01-28 12:50

    On Windows you can use GetTempPath function that simply expands your %TEMP% env variable.

    Note, that starting from C++17 you can use std::filesystem::temp_directory_path

提交回复
热议问题