Click here to Skip to main content
15,890,123 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
Will the function getenv() works in all windows machine?
Posted

1 solution

Hi,

getenv(..) comes from stdlib.h and belongs to the ANSI C standard functions. It will work on every system that has a C runtime library, not just on Windows machines.

The Microsoft help page about the function (here) states it will work on: Windows 95, Windows 98, Windows 98 Second Edition, Windows Millennium Edition, Windows NT 4.0, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 .. and I am pretty sure they just forgot to mention their newer systems.

They also mention that the function is deprecated and that getenv_s should be used instead.

I hope that helps.

Cheerio!
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900