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

size_t类型


描述:

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


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

#include <stdio.h>
#include <stdlib.h>

int main(void)
{
    size_t a = sizeof(int);
    printf("int type: %zu bytes\n", a);

    return 0;
}


输出:

int type: 4 bytes


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