全局变量Global Variables
Microsoft C 运行时库提供了以下全局变量或宏。The Microsoft C run-time library provides the following global variables or macros. 已弃用几个全局变量或宏,以便使用我们建议的更安全的函数版本,而非全局变量。Several of these global variables or macros have been deprecated in favor of more-secure functional versions, which we recommend you use instead of the global variables.
变量Variable | 描述Description |
---|---|
__argc、__argv、__wargv__argc, __argv, __wargv | 包含命令行自变量。Contains the command-line arguments. |
_daylight、_dstbias、_timezone,和 _tzname_daylight, _dstbias, _timezone, and _tzname | 已否决。Deprecated. 请改为使用 _get_daylight 、_get_dstbias 、_get_timezone 和 _get_tzname 。Instead, use _get_daylight , _get_dstbias , _get_timezone , and _get_tzname .调整本地时间;用于一些日期和时间函数。Adjusts for local time; used in some date and time functions. |
errno、_doserrno、_sys_errlist 和 _sys_nerrerrno, _doserrno, _sys_errlist, and _sys_nerr | 已否决。Deprecated. 请改为使用 _get_errno 、_set_errno 、_get_doserrno 、_set_doserrno 、perror 和 strerror 。Instead, use _get_errno , _set_errno , _get_doserrno , _set_doserrno , perror and strerror .存储错误代码和相关信息。Stores error codes and related information. |
_environ、_wenviron_environ, _wenviron | 已否决。Deprecated. 请改为使用 getenv_s 、_wgetenv_s 、_dupenv_s 、_wdupenv_s 、_putenv_s 和 _wputenv_s 。Instead, use getenv_s , _wgetenv_s , _dupenv_s , _wdupenv_s , _putenv_s , and _wputenv_s .指向进程环境字符串的指针数组的指针;在启动时进行初始化。Pointers to arrays of pointers to the process environment strings; initialized at startup. |
_fmode_fmode | 已否决。Deprecated. 请改为使用 _get_fmode 或 _set_fmode 。Instead, use _get_fmode or _set_fmode .设置默认文件转换模式。Sets default file-translation mode. |
_iob_iob | 控制台、文件和设备的 I/O 控制结构的数组。Array of I/O control structures for the console, files, and devices. |
_pctype、_pwctype、_wctype、_mbctype、_mbcasemap_pctype, _pwctype, _wctype, _mbctype, _mbcasemap | 包含由 character-classification 函数使用的信息。Contains information used by the character-classification functions. |
_pgmptr、_wpgmptr_pgmptr, _wpgmptr | 已否决。Deprecated. 请改为使用 _get_pgmptr 或 _get_wpgmptr 。Instead, use _get_pgmptr or _get_wpgmptr .在程序启动时初始化到该程序的完全限定路径或相对路径、完整程序名或不包含其文件扩展名的程序名,具体取决于调用该程序的方式。Initialized at program startup to the fully-qualified or relative path of the program, the full program name, or the program name without its file name extension, depending on how the program was invoked. |
请参阅See Also
C 运行时库参考 C Run-Time Library Reference
全局常量 Global Constants
__argc、__argv、__wargv __argc, __argv, __wargv
_get_daylight _get_daylight
_get_dstbias _get_dstbias
_get_timezone _get_timezone
_get_tzname _get_tzname
perror perror
strerror strerror
_get_doserrno _get_doserrno
_set_doserrno _set_doserrno
_get_errno _get_errno
_set_errno _set_errno
_dupenv_s、_wdupenv_s _dupenv_s, _wdupenv_s
getenv、_wgetenv getenv, _wgetenv
getenv_s、_wgetenv_s getenv_s, _wgetenv_s
_putenv、_wputenv _putenv, _wputenv
_putenv_s、_wputenv_s _putenv_s, _wputenv_s
_get_fmode _get_fmode
_set_fmode_set_fmode