当前位置: C语言 -- 标准库 -- <wchar.h> -- size_t

size_t类型


描述:

该类型是表示sizeof运算符运算结果的无符号整数类型。


范例:
1 
2 
3 
4 
5 
6 
7 
8 
9 
10 
11 
12 
13 
14 
/*类型size_t范例*/

#include <stdio.h>
#include <wchar.h>

int main(void)
{
    size_t length;
    length = sizeof(wchar_t);
    printf("wchar_t type: %zu\n", length);
    
    return 0;
}


输出:

wchar_t type: 2

注:wchar_t类型数据占用的字节数与具体实现有关。


相关内容:
wint_t 宽整数类型。
wchar_t 宽字符类型。