函数getenv()是否可以在所有Windows机器上使用? [英] Will the function getenv() works in all windows machine?

查看:797
本文介绍了函数getenv()是否可以在所有Windows机器上使用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

函数getenv()是否可以在所有Windows计算机上使用?

Will the function getenv() works in all windows machine?

推荐答案



getenv(..)来自stdlib.h,属于ANSI C标准函数.它可以在具有C运行时库的每个系统上运行,而不仅仅是在Windows计算机上.

有关该功能的Microsoft帮助页面(此处)指出它将工作于: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 ..而且我敢肯定,他们只是忘了提及他们的较新的系统.

他们还提到不建议使用该函数,而应改用getenv_s.

希望对您有所帮助.

加油!
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!


这篇关于函数getenv()是否可以在所有Windows机器上使用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆