Temporary file using MSFT API in cpp

C++
using namespace System::Security;using namespace System::IO; ... String tempFolder;try {  tempFolder = Path::GetTempPath();}catch(SecurityException* ex){  // probably means that you don't have the required permissions}catch(Exception* ex){  // handle all other exceptions}
Source

Also in C++: