Getting user temporary folder path in Windows

后端 未结 9 1606
醉梦人生
醉梦人生 2020-12-30 00:45

How I can get the user\'s temp folder path in C++? My program has to run on Windows Vista and XP and they have different temp paths. How I can get it without losing compatib

9条回答
  •  攒了一身酷
    2020-12-30 01:35

    #include 
    #include 
    
    int main(int argc, char* argv[]){
    
        std::cout << getenv("TEMP") << std::endl;
    
        return 0;
    }
    

提交回复
热议问题