[go: up one dir, main page]

Menu

[4cf102]: / ebe_toybox.cpp  Maximize  Restore  History

Download this file

87 lines (72 with data), 1.1 kB

 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
77
78
79
80
81
82
83
84
85
86
#include <cstdio>
#include <cmath>
void print_type(double x)
{
printf("double\n");
}
void print_type(float x)
{
printf("float\n");
}
void print_type(unsigned long x)
{
printf("unsigned long\n");
}
void print_type(long x)
{
printf("long\n");
}
void print_type(unsigned int x)
{
printf("unsigned int\n");
}
void print_type(int x)
{
printf("int\n");
}
void print_type(unsigned short x)
{
printf("unsigned short\n");
}
void print_type(short x)
{
printf("short\n");
}
void print_type(signed char x)
{
printf("signed char\n");
}
void print_type(unsigned char x)
{
printf("unsigned char\n");
}
void print_type(char x)
{
printf("char\n");
}
void print_type(bool x)
{
printf("bool\n");
}
template <class T>
void dump ( T v )
{
T x = v;
int i;
print_type(x);
for ( i = 0; i < sizeof(T); i++ ) {
printf("%02x ",((unsigned char *)&x)[i]);
}
printf("\n");
}
int main()
{
int a = 100;
int b = 6;
int negb = -7;
dump(a / negb);
printf("%d\n",a);
printf("%d\n",b);
printf("%d\n",negb);
return 0;
}