标准类型Standard Types

Microsoft 运行库定义下列标准类型和 typedef。The Microsoft run-time library defines the following standard types and typedefs.

定宽整型类型 (stdint.h)Fixed-width integral types (stdint.h)

nameName 等效内置类型Equivalent built-in type
int8_t、uint8_tint8_t, uint8_t signed char、unsigned charsigned char, unsigned char
int16_t、uint16_tint16_t, uint16_t short、unsigned shortshort, unsigned short
int32_t、uint32_tint32_t, uint32_t int、unsigned intint, unsigned int
int64_t、uint64_tint64_t, uint64_t long long、unsigned long longlong long, unsigned long long
int_least8_t、uint_least8_tint_least8_t, uint_least8_t signed char、unsigned charsigned char, unsigned char
int_least16_t、uint_least16_tint_least16_t, uint_least16_t short、unsigned shortshort, unsigned short
int_least32_t、uint_least32_tint_least32_t, uint_least32_t int、unsigned intint, unsigned int
int_least64_t、uint_least64_tint_least64_t, uint_least64_t long long、unsigned long longlong long, unsigned long long
int_fast8_t、uint_fast8_tint_fast8_t, uint_fast8_t signed char、unsigned charsigned char, unsigned char
int_fast16_t、uint_fast16_tint_fast16_t, uint_fast16_t int、unsigned intint, unsigned int
int_fast32_t、uint_fast32_tint_fast32_t, uint_fast32_t int、unsigned intint, unsigned int
int_fast64_t、uint_fast64_tint_fast64_t, uint_fast64_t long long、unsigned long longlong long, unsigned long long
intmax_t、uintmax_tintmax_t, uintmax_t long long、unsigned long longlong long, unsigned long long
类型Type 描述Description 声明位置Declared in
clock_t (long)clock_t (long) 存储时间值;由 clock 使用。Stores time values; used by clock. TIME.HTIME.H
_complex 结构_complex structure 存储复数的实数部分和虚数部分;由 _cabs 使用。Stores real and imaginary parts of complex numbers; used by _cabs. MATH.HMATH.H
_CRT_ALLOC_HOOK 用户定义的挂钩函数的类型定义。A type define for the user-defined hook function. _CrtSetAllocHook 中使用。Used in _CrtSetAllocHook. CRTDBG.HCRTDBG.H
_CRT_DUMP_CLIENT,_CRT_DUMP_CLIENT,

_CRT_DUMP_CLIENT_M
将在 _CrtMemDumpAllObjectsSince 中调用的回调函数的类型定义。A type define for a call-back function that will get called in _CrtMemDumpAllObjectsSince. CRTDBG.HCRTDBG.H
_CrtMemState 结构_CrtMemState structure 提供有关 C 运行时调试堆的当前状态的信息。Provides information about the current state of the C run-time debug heap. CRTDBG.HCRTDBG.H
_CRT_REPORT_HOOK,_CRT_REPORT_HOOK,

_CRT_REPORT_HOOKW,_CRT_REPORT_HOOKW,

_CRT_REPORT_HOOKW_M
将在 _CrtDbgReport 中调用的回调函数的类型定义。A type define for a call-back function that will get called in _CrtDbgReport.

此函数的参数包括:报告类型、输出消息和回调函数的返回值。The parameters for this function are: report type, output message and the return value from the call-back function.
CRTDBG.HCRTDBG.H
dev_t_dev_t short 或 unsigned integerdev_t, _dev_t short or unsigned integer 表示设备句柄。Represents device handles. SYS\TYPES.HSYS\TYPES.H
_diskfree_t 结构_diskfree_t structure 包含有关磁盘驱动器的信息。Contains information about a disk drive. _getdiskfree 使用。Used by _getdiskfree. DOS.H 和 DIRECT.HDOS.H and DIRECT.H
div_tldiv_tlldiv_t 结构div_t, ldiv_t and lldiv_t structures 存储由 divldivlldiv 分别返回的值。Store values returned by div, ldiv, and lldiv, respectively. STDLIB.HSTDLIB.H
errno_t integererrno_t integer 用于处理 errno 的错误代码的函数返回类型或参数。Used for a function return type or parameter that deals with the error codes of errno. STDDEF.H、STDDEF.H,

CRTDEFS.HCRTDEFS.H
_exception 结构_exception structure 存储 _matherr 的错误信息。Stores error information for _matherr. MATH.HMATH.H
_EXCEPTION_POINTERS 包含一个异常记录。Contains an exception record. 有关详细信息,请参阅 EXCEPTION_POINTERSSee EXCEPTION_POINTERS for more information. FPIEEE.HFPIEEE.H
FILE 结构FILE structure 存储有关流的当前状态的信息;在所有流 I/O 操作中使用。Stores information about current state of stream; used in all stream I/O operations. STDIO.HSTDIO.H
_finddata_t_wfinddata_t_finddata32_t_wfinddata32_t_finddatai64_t_wfinddatai64_t__finddata64_t__wfinddata64_t__finddata32i64_t__wfinddata32i64_t__finddata64i32_t__wfinddata64i32_t 结构_finddata_t, _wfinddata_t, _finddata32_t, _wfinddata32_t, _finddatai64_t, _wfinddatai64_t, __finddata64_t, __wfinddata64_t, __finddata32i64_t, __wfinddata32i64_t, __finddata64i32_t, __wfinddata64i32_t structures 存储由 _findfirst、_wfindfirst 和相关函数_findnext、_wfindnext 和相关函数返回的文件特性信息。Store file-attribute information returned by _findfirst, _wfindfirst, and related functions and _findnext, _wfindnext and related functions. 有关结构成员的信息,请参阅文件名称搜索函数See Filename Search Functions for information on structure members. IO.H、WCHAR.HIO.H, WCHAR.H
_FPIEEE_RECORD 结构_FPIEEE_RECORD structure 包含有关 IEEE 浮点异常的信息;由 _fpieee_flt 传递给用户定义的陷阱处理程序。Contains information pertaining to IEEE floating-point exception; passed to user-defined trap handler by _fpieee_flt. FPIEEE.HFPIEEE.H
fpos_t(long integer、__int64 或结构,取决于目标平台)fpos_t (long integer, __int64, or structure, depending on the target platform) fsetposfgetpos 用于记录信息以在文件中唯一指定每个位置。Used by fgetpos and fsetpos to record information for uniquely specifying every position within a file. STDIO.HSTDIO.H
_fsize_t (unsigned long integer)_fsize_t (unsigned long integer) 用于表示文件的大小。Used to represent the size of a file. IO.H、IO.H,

WCHAR.HWCHAR.H
_HEAPINFO 结构_HEAPINFO structure 包含有关 _heapwalk 的下一个堆条目的信息。Contains information about next heap entry for _heapwalk. MALLOC.HMALLOC.H
_HFILE (void *)_HFILE (void *) 操作系统文件句柄。An operating system file handle. CRTDBG.HCRTDBG.H
imaxdiv_t imaxdiv 函数返回的值的类型,包含商和余数。The type of value that's returned by the imaxdiv function, containing both the quotient and the remainder. inttypes.hinttypes.h
ino_t_ino_t (unsigned short)ino_t, _ino_t (unsigned short) 用于返回状态信息。For returning status information. WCHAR.HWCHAR.H
intmax_t 一个带符号整数类型,能够表示任何带符号整数类型的任何值。A signed integer type capable of representing any value of any signed integer type. stdint.hstdint.h
intptr_t(long integer 或 __int64,取决于目标平台)intptr_t (long integer or __int64, depending on the target platform) 在 Win32 和 Win64 平台上存储指针(或 HANDLE)。Stores a pointer (or HANDLE) on both Win32 and Win64 platforms. STDDEF.H 和其他包含文件STDDEF.H and other include files
jmp_buf 数组jmp_buf array setjmplongjmp 用于保存和还原程序环境。Used by setjmp and longjmp to save and restore program environment. SETJMP.HSETJMP.H
lconv 结构lconv structure 包含数字值在不同国家/地区的格式设置规则。Contains formatting rules for numeric values in different countries/regions. localeconv 使用。Used by localeconv. LOCALE.HLOCALE.H
_LDOUBLE,_LDOUBLE,

_LONGDOUBLE,_LONGDOUBLE,

_LDBL12(long double 或 unsigned char 数组)_LDBL12 (long double or an unsigned char array)
用于表示一个长双精度值。Use to represent a long double value. STDLIB.HSTDLIB.H
_locale_t 结构_locale_t structure 存储当前区域设置值;在所有区域设置特定 C 运行库中使用。Stores current locale values; used in all locale specific C run-time libraries. CRTDEF.HCRTDEF.H
mbstate_t 跟踪多字节字符转换的状态。Tracks the state of a multibyte character conversion. WCHAR.HWCHAR.H
off_t_off_t long integeroff_t, _off_t long integer 表示文件偏移量值。Represents file-offset value. WCHAR.H、SYS\TYPES.HWCHAR.H, SYS\TYPES.H
_onexit_t,_onexit_t,

_onexit_m_t 指针_onexit_m_t pointer
_onexit、_onexit_m 返回。Returned by _onexit, _onexit_m. STDLIB.HSTDLIB.H
指向函数的 _PNH 指针_PNH pointer to function _set_new_handler 的参数的类型。Type of argument to _set_new_handler. NEW.HNEW.H
ptrdiff_t(long integer 或 __int64,取决于目标平台)ptrdiff_t (long integer or __int64, depending on the target platform) 两个指针相减的结果。Result of subtraction of two pointers. CRTDEFS.HCRTDEFS.H
_purecall_handler,_purecall_handler,

_purecall_handler_m
调用纯虚函数时调用的回调函数的类型定义。A type define for a call-back function that is called when a pure virtual function is called. _get_purecall_handler、_set_purecall_handler 使用。Used by _get_purecall_handler, _set_purecall_handler. _purecall_handler 函数应具有 void 返回类型。A _purecall_handler function should have a void return type. STDLIB.HSTDLIB.H
_RTC_error_fn 类型定义_RTC_error_fn type define 将处理运行时错误检查的函数的类型定义。A type define for a function that will handle run-time error checks. _RTC_SetErrorFunc 中使用。Used in _RTC_SetErrorFunc. RTCAPI.HRTCAPI.H
_RTC_error_fnW 类型定义_RTC_error_fnW type define 将处理运行时错误检查的函数的类型定义。A type define for a function that will handle run-time error checks. _RTC_SetErrorFuncW 中使用。Used in _RTC_SetErrorFuncW. RTCAPI.HRTCAPI.H
_RTC_ErrorNumber 枚举_RTC_ErrorNumber enumeration 定义 _RTC_GetErrDesc_RTC_SetErrorType 的错误条件。Defines error conditions for _RTC_GetErrDesc and _RTC_SetErrorType. RTCAPI.HRTCAPI.H
_se_translator_function 转换异常的回调函数的类型定义。A type define for a call-back function that translates an exception. 第一个参数是异常代码,第二个参数是异常记录。The first parameter is the exception code and the second parameter is the exception record. _set_se_translator 使用。Used by _set_se_translator. EH.HEH.H
sig_atomic_t integersig_atomic_t integer 可修改为原子实体(即使在出现异步中断时也是如此)的对象的类型;与 signal 一起使用。Type of object that can be modified as atomic entity, even in presence of asynchronous interrupts; used with signal. SIGNAL.HSIGNAL.H
size_t(unsigned __int64 或 unsigned integer,取决于目标平台)size_t (unsigned __int64 or unsigned integer, depending on the target platform) sizeof 运算符的结果。Result of sizeof operator. CRTDEFS.H 和其他包含文件CRTDEFS.H and other include files
_stat 结构_stat structure 包含 _stat_fstat 返回的文件状态信息。Contains file-status information returned by _stat and _fstat. SYS\STAT.HSYS\STAT.H
__stat64 结构__stat64 structure 包含 _fstat64_stat64_wstat64 返回的文件状态信息。Contains file-status information returned by _fstat64 and _stat64, and _wstat64. SYS\STAT.HSYS\STAT.H
_stati64 结构_stati64 structure 包含 _fstati64_stati64_wstati64 返回的文件状态信息。Contains file-status information returned by _fstati64, _stati64, and _wstati64. SYS\STAT.HSYS\STAT.H
terminate_function 类型定义terminate_function type define 调用 terminate 时调用的回调函数的类型定义。A type define for a call-back function that is called when terminate is called. set_terminate 使用。Used by set_terminate. EH.HEH.H
time_t(__int64 或 long integer)time_t (__int64 or long integer) 表示 mktimetimectime、_ctime32、_ctime64、_wctime、_wctime32、_wctime64ctime_s、_ctime32_s、_ctime64_s、_wctime_s、_wctime32_s、_wctime64_sctime、_ctime32、_ctime64、_wctime、_wctime32、_wctime64gmtime、_gmtime32、_gmtime64 中的时间值。Represents time values in mktime, time, ctime, _ctime32, _ctime64, _wctime, _wctime32, _wctime64, ctime_s, _ctime32_s, _ctime64_s, _wctime_s, _wctime32_s, _wctime64_s, ctime, _ctime32, _ctime64, _wctime, _wctime32, _wctime64 and gmtime, _gmtime32, _gmtime64. 自 1970 年 1 月 1 日 0:00 (UTC) 时起的秒数。The number of seconds since January 1, 1970, 0:00 UTC. 如果定义 _USE_32BIT_TIME_T,则 time_t 为 long integer。If _USE_32BIT_TIME_T is defined, time_t is a long integer. 如果未定义,则它为 64 位整数。If not defined, it is a 64-bit integer. TIME.H、TIME.H,

SYS\STAT.H、SYS\STAT.H,

SYS\TIMEB.HSYS\TIMEB.H
__time32_t (long integer)__time32_t (long integer) 表示 mktime、_mktime32、_mktime64ctime、_ctime32、_ctime64、_wctime、_wctime32、_wctime64ctime_s、_ctime32_s、_ctime64_s、_wctime_s、_wctime32_s、_wctime64_sgmtime、_gmtime32、_gmtime64localtime、_localtime32、_localtime64 中的时间值。Represents time values in mktime, _mktime32, _mktime64, ctime, _ctime32, _ctime64, _wctime, _wctime32, _wctime64, ctime_s, _ctime32_s, _ctime64_s, _wctime_s, _wctime32_s, _wctime64_s, gmtime, _gmtime32, _gmtime64 and localtime, _localtime32, _localtime64. CRTDEFS.H、SYS\STAT.H、CRTDEFS.H, SYS\STAT.H,

SYS\TIMEB.HSYS\TIMEB.H
__time64_t (__int64)__time64_t (__int64) 表示 mktime、_mktime32、_mktime64_ctime64、_wctime64ctime_s、 _ctime32_s、_ctime64_s、_wctime_s、_wctime32_s、_wctime64_s_gmtime64_localtime64_time64 中的时间值。Represents time values in mktime, _mktime32, _mktime64, _ctime64, _wctime64, ctime_s, _ctime32_s, _ctime64_s, _wctime_s, _wctime32_s, _wctime64_s, _gmtime64, _localtime64 and _time64. TIME.H、TIME.H,

SYS\STAT.H、SYS\STAT.H,

SYS\TIMEB.HSYS\TIMEB.H
_timeb 结构_timeb structure _ftime_ftime_s、_ftime32_s、_ftime64_s 用于存储当前系统时间。Used by _ftime and _ftime_s, _ftime32_s, _ftime64_s to store current system time. SYS\TIMEB.HSYS\TIMEB.H
__timeb32 结构__timeb32 structure _ftime、_ftime32、_ftime64_ftime_s、_ftime32_s、_ftime64_s 用于存储当前系统时间。Used by _ftime, _ftime32, _ftime64 and _ftime_s, _ftime32_s, _ftime64_s to store current system time. SYS\TIMEB.HSYS\TIMEB.H
__timeb64 结构__timeb64 structure _ftime64_ftime_s、_ftime32_s、_ftime64_s 用于存储当前系统时间。Used by _ftime64 and _ftime_s, _ftime32_s, _ftime64_s to store current system time. SYS\TIMEB.HSYS\TIMEB.H
tm 结构tm structure asctime、_wasctimeasctime_s、_wasctime_sgmtime、_gmtime32、_gmtime64gmtime_s、_gmtime32_s、_gmtime64_slocaltime、_localtime32、_localtime64localtime_s、_localtime32_s、_localtime64_smktime、_mktime32、_mktime64strftime、wcsftime、_strftime_l, _wcsftime_l 用于存储和检索时间信息。Used by asctime, _wasctime, asctime_s, _wasctime_s, gmtime, _gmtime32, _gmtime64, gmtime_s, _gmtime32_s, _gmtime64_s, localtime, _localtime32, _localtime64, localtime_s, _localtime32_s, _localtime64_s, mktime, _mktime32, _mktime64 and strftime, wcsftime, _strftime_l, _wcsftime_l to store and retrieve time information. TIME.HTIME.H
uintmax_t 一个带符号整数类型,能够表示任何带符号整数类型的任何值。An unsigned integer type capable of representing any value of any unsigned integer type. stdint.hstdint.h
uintptr_t(long integer 或 __int64,取决于目标平台)uintptr_t (long integer or __int64, depending on the target platform) intptr_t 的 unsigned integer 或 unsigned __int64 版本An unsigned integer or unsigned __int64 version of intptr_t. STDDEF.H 和其他包含文件STDDEF.H and other include files
unexpected_function 调用 unexpected 时调用的回调函数的类型定义。A type define for a call-back function that is called when unexpected is called. set_unexpected 使用。Used by set_unexpected. EH.HEH.H
_utimbuf 结构_utimbuf structure 存储 _utime、_wutime_futime、_futime32、_futime64 用于更改文件修改日期的文件访问时间和修改时间。Stores file access and modification times used by _utime, _wutime and _futime, _futime32, _futime64 to change file-modification dates. SYS\UTIME.HSYS\UTIME.H
_utimbuf32 结构_utimbuf32 structure 存储 _utime、_utime32、_utime64、_wutime、_wutime32、_wutime64_futime、_futime32、_futime64 用于更改文件修改日期的文件访问时间和修改时间。Stores file access and modification times used by _utime, _utime32, _utime64, _wutime, _wutime32, _wutime64 and _futime, _futime32, _futime64 to change file-modification dates. SYS\UTIME.HSYS\UTIME.H
__utimbuf64 结构__utimbuf64 structure _utime64、_wutime64_futime64 用于存储当前时间。Used by _utime64, _wutime64 and _futime64 to store the current time. SYS\UTIME.HSYS\UTIME.H
va_list 结构va_list structure 用于保留 va_argva_end 宏所需的信息。Used to hold information needed by va_arg and va_end macros. 被调用的函数将可作为参数传递的 va_list 类型的变量声明为另一个函数。Called function declares variable of type va_list that can be passed as argument to another function. STDARG.H、STDARG.H,

CRTDEFS.HCRTDEFS.H
wchar_t 宽字符wchar_t wide character 用于为国际市场编写可移植程序。Useful for writing portable programs for international markets. STDDEF.H、STDLIB.H、STDDEF.H, STDLIB.H,

CRTDEFS.H、CRTDEFS.H,

SYS\STAT.HSYS\STAT.H
wctrans_t integerwctrans_t integer 表示区域设置特定字符映射。Represents locale-specific character mappings. WCTYPE.HWCTYPE.H
wctype_t integerwctype_t integer 可表示任何语言字符集的所有字符。Can represent all characters of any language character set. WCHAR.H、WCHAR.H,

CRTDEFS.HCRTDEFS.H
wint_t integerwint_t integer 可保留任何宽字符或宽文件尾值的数据对象的类型。Type of data object that can hold any wide character or wide end-of-file value. WCHAR.H、WCHAR.H,

CRTDEFS.HCRTDEFS.H

请参阅See Also

C 运行时库参考C Run-Time Library Reference