-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_tmp.cpp
More file actions
71 lines (66 loc) · 1.13 KB
/
Copy pathtest_tmp.cpp
File metadata and controls
71 lines (66 loc) · 1.13 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
#include <iostream>
#include <fstream>
#include <vector>
#include <map>
#include <unordered_map>
#include <unistd.h>
using namespace std;
class A {
public:
virtual int fun() = 0;
;
};
class B : public A {
public:
virtual int fun() {
return 0;
}
};
int fun(int a) {
cout << "fun(int)\n";
return a;
}
int fun(int a, int b = 0) {
cout << "fun(int, int)\n";
return a + b;
}
class AA {
public:
int x = fun(3, 5);
} a;
struct C {
virtual void reset() {
;
}
C() {
cout << "C()\n";
}
void operator()() {
cout << "operator()()\n";
}
};
class D {
virtual void reset() {}
};
class D1 : public D {
virtual void reset() {}
};
class D2 : public D {
virtual void reset() {}
};
int main() {
C()();
C()();
cout << sizeof(C);
D d;
D1 d11, d12;
D2 d21, d22;
cout << *(uint64_t*)(&d) << endl;
cout << *(uint64_t*)(&d11) << endl;
cout << *(uint64_t*)(&d12) << endl;
cout << *(uint64_t*)(&d21) << endl;
cout << *(uint64_t*)(&d22) << endl;
for (int i = -22; i < 22; ++i) {
cout << i << ',' << i / 10 << '\t';
}
}