I am new to CPP. I will like to ask for P_tmpdir macro in stdlib.h where does P_tmpdir gets the temporary directory from ? Does P_tmpdir looks into the environment for the location of the temp directory, or is it a directory that is set when C++ is installed.
The path prefix defined as P_tmpdir is part of SVID (and IIRC also part of the single unix).
In unix or Unix-like implementations, it is defined (usually as either /tmp or /var/tmp) in <stdio.h>
GetTempPath() is a windows api function, P_tmpdir is an SVID macro. Both provide like functionality; P_tmpdir always evaluates to the same directory while GetTempPath() looks up environment variables.