This C++ code is being ported from Linux. Is it safe to use these functions under Windows, or do I need to replace them with Windows specific equivalents?
You may use these by including suitable header files.
fopen() include stdio.hgetenv() include stdio.h and stdlib.h
[shell]t.c(15): warning #1786: function "getenv" (declared at line 447 of "c:Program FilesMicrosoft Visual Studio 9.0VCINCL
UDEstdlib.h") was declared "deprecated ("This function or variable may be unsafe. Consider using _dupenv_s instead. To
disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.") "
libvar = getenv( "LIB" );
So it's above warning then. It would be better to use the new API.