-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtype.cpp
More file actions
45 lines (39 loc) · 879 Bytes
/
type.cpp
File metadata and controls
45 lines (39 loc) · 879 Bytes
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
#include <iostream>
#include <typeinfo>
#include <cstring>
#define PRINT_TYPE(x) std::cout << #x << std::string(20-strlen(#x),' ') << typeid(x).name() << '\n';
const char * types[] = {
"signed char",
"unsigned char",
"char",
"short",
"unsigned short",
"int",
"unsigned int",
"long",
"unsigned long",
"long long",
"unsigned long long",
"float",
"double",
"long double",
"bool",
};
int main() {
PRINT_TYPE(signed char);
PRINT_TYPE(bool);
PRINT_TYPE(char);
PRINT_TYPE(double);
PRINT_TYPE(long double);
PRINT_TYPE(float);
PRINT_TYPE(unsigned char);
PRINT_TYPE(int);
PRINT_TYPE(unsigned int);
PRINT_TYPE(long);
PRINT_TYPE(unsigned long);
PRINT_TYPE(short);
PRINT_TYPE(unsigned short);
PRINT_TYPE(long long);
PRINT_TYPE(unsigned long long);
//...
}