-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
63 lines (51 loc) · 979 Bytes
/
Copy pathmain.cpp
File metadata and controls
63 lines (51 loc) · 979 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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#include <iostream>
#include "test.h"
#include "Cube.h"
using namespace std;
#define NUM_THREADS 5
const int PI = 3.14;
int calculate(int w, int h);
template<class T> void mySwap(T &a, T &b) {
T temp;
temp = a;
a = b;
b = temp;
}
// 线程的运行函数
void* say_hello(void* args)
{
cout << "Hello Runoob!" << endl;
cout << "int size :" << sizeof(int) << endl;
system("pause");
return 0;
}
class Circle {
public:
int r;
int getL();
};
int Circle::getL() {
return r*PI;
};
int main()
{
cout << calculate(3, 2);
say_hello(nullptr);
MathMax *max;
max->a = 3;
max->b = 3;
cout << max->func() << endl;
Circle circle;
circle.r = 3;
cout << circle.getL() << endl;
Cube cube;
cube.setEdge(4,4);
cout << cube.getArea() << endl;
int a = 3;
int * p = &a;
cout << a << *p << endl;
int c = 5;
int d = 6;
mySwap<int>(c, d);
cout << c << d << endl;
}