-
Notifications
You must be signed in to change notification settings - Fork 0
/
sizeof.c
76 lines (53 loc) · 1.24 KB
/
sizeof.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
#include <stdio.h>
#include <stdint.h>
#include <stdbool.h>
#include <uchar.h>
#include <wchar.h>
#include <math.h> // float_t, double_t
#define out(datatype) printf("%-20s: %2d bytes\n", #datatype, sizeof(datatype));
int main() {
out(bool )
out(char )
out(char16_t )
out(char32_t )
out(double )
out(double_t )
out(float )
out(float_t )
out(int )
out(int_fast8_t )
out(int_fast16_t )
out(int_fast32_t )
out(int_fast64_t )
out(int_least8_t )
out(int_least16_t )
out(int_least32_t )
out(int_least64_t )
out(intmax_t )
out(intptr_t )
out(mbstate_t )
out(long )
out(long double )
out(long long )
out(long long int )
out(short )
out(short int )
out(uint8_t )
out(uint8_t )
out(uint16_t )
out(uint32_t )
out(uint64_t )
out(uintmax_t )
out(uintptr_t )
out(uint_fast8_t )
out(uint_fast16_t )
out(uint_fast32_t )
out(uint_fast64_t )
out(uint_least8_t )
out(uint_least16_t)
out(uint_least32_t)
out(uint_least64_t)
out(void* )
out(wchar_t )
out(wint_t )
}