Skip to content

Commit f53ae1d

Browse files
committed
c++ Makefile & Debugging
1 parent 3f89ac6 commit f53ae1d

File tree

20 files changed

+500
-289
lines changed

20 files changed

+500
-289
lines changed
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# A collection of useful .gitignore templates
2+
# https://github.com/github/gitignore
3+
4+
# General
5+
.DS_Store
6+
dir/otherdir/.DS_Store
7+
8+
out/
9+
.vscode/
10+
a.out.dSYM/
11+
12+
# Prerequisites
13+
*.d
14+
15+
# Compiled Object files
16+
*.slo
17+
*.lo
18+
*.o
19+
*.obj
20+
21+
# Precompiled Headers
22+
*.gch
23+
*.pch
24+
25+
# Compiled Dynamic libraries
26+
*.so
27+
*.dylib
28+
*.dll
29+
30+
# Fortran module files
31+
*.mod
32+
*.smod
33+
34+
# Compiled Static libraries
35+
*.lai
36+
*.la
37+
*.a
38+
*.lib
39+
40+
# Executables
41+
*.exe
42+
*.out
43+
*.app
44+
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Result
2+
3+
```
4+
2
5+
```
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#include <iostream>
2+
3+
template <typename T>
4+
T max(T x, T y)
5+
{
6+
return (x < y) ? y: x;
7+
}
8+
9+
int main() {
10+
std::cout << max<int>(1,2) << std::endl;
11+
12+
return 0;
13+
}
Lines changed: 132 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,132 @@
1+
# A collection of useful .gitignore templates
2+
# https://github.com/github/gitignore
3+
4+
# General
5+
.DS_Store
6+
dir/otherdir/.DS_Store
7+
8+
out/
9+
.vscode/
10+
a.out.dSYM/
11+
12+
# Prerequisites
13+
*.d
14+
15+
# Compiled Object files
16+
*.slo
17+
*.lo
18+
*.o
19+
*.obj
20+
21+
# Precompiled Headers
22+
*.gch
23+
*.pch
24+
25+
# Compiled Dynamic libraries
26+
*.so
27+
*.dylib
28+
*.dll
29+
30+
# Fortran module files
31+
*.mod
32+
*.smod
33+
34+
# Compiled Static libraries
35+
*.lai
36+
*.la
37+
*.a
38+
*.lib
39+
40+
# Executables
41+
*.exe
42+
*.out
43+
*.app
44+
45+
# A collection of useful .gitignore templates
46+
# https://github.com/github/gitignore
47+
48+
# General
49+
.DS_Store
50+
dir/otherdir/.DS_Store
51+
52+
out/
53+
.vscode/
54+
a.out.dSYM/
55+
56+
# Prerequisites
57+
*.d
58+
59+
# Compiled Object files
60+
*.slo
61+
*.lo
62+
*.o
63+
*.obj
64+
65+
# Precompiled Headers
66+
*.gch
67+
*.pch
68+
69+
# Compiled Dynamic libraries
70+
*.so
71+
*.dylib
72+
*.dll
73+
74+
# Fortran module files
75+
*.mod
76+
*.smod
77+
78+
# Compiled Static libraries
79+
*.lai
80+
*.la
81+
*.a
82+
*.lib
83+
84+
# Executables
85+
*.exe
86+
*.out
87+
*.app
88+
89+
# A collection of useful .gitignore templates
90+
# https://github.com/github/gitignore
91+
92+
# General
93+
.DS_Store
94+
dir/otherdir/.DS_Store
95+
96+
out/
97+
.vscode/
98+
a.out.dSYM/
99+
100+
# Prerequisites
101+
*.d
102+
103+
# Compiled Object files
104+
*.slo
105+
*.lo
106+
*.o
107+
*.obj
108+
109+
# Precompiled Headers
110+
*.gch
111+
*.pch
112+
113+
# Compiled Dynamic libraries
114+
*.so
115+
*.dylib
116+
*.dll
117+
118+
# Fortran module files
119+
*.mod
120+
*.smod
121+
122+
# Compiled Static libraries
123+
*.lai
124+
*.la
125+
*.a
126+
*.lib
127+
128+
# Executables
129+
*.exe
130+
*.out
131+
*.app
132+
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Result
2+
3+
```
4+
5+
12206
6+
```
7+
# Result
8+
9+
```
10+
11+
```
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#define WIDTH 5
2+
3+
#define HEIGHT 3
4+
5+
#include <iostream>
6+
7+
int jimmy [HEIGHT][WIDTH];
8+
9+
int n,m;
10+
11+
int main() {
12+
for (n=0;n<HEIGHT;n++){
13+
for (m=0; m<WIDTH; m++){
14+
jimmy[n][m]=(n+1)*(m+1);
15+
}
16+
}
17+
return 0;
18+
}
Lines changed: 132 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,132 @@
1+
# A collection of useful .gitignore templates
2+
# https://github.com/github/gitignore
3+
4+
# General
5+
.DS_Store
6+
dir/otherdir/.DS_Store
7+
8+
out/
9+
.vscode/
10+
a.out.dSYM/
11+
12+
# Prerequisites
13+
*.d
14+
15+
# Compiled Object files
16+
*.slo
17+
*.lo
18+
*.o
19+
*.obj
20+
21+
# Precompiled Headers
22+
*.gch
23+
*.pch
24+
25+
# Compiled Dynamic libraries
26+
*.so
27+
*.dylib
28+
*.dll
29+
30+
# Fortran module files
31+
*.mod
32+
*.smod
33+
34+
# Compiled Static libraries
35+
*.lai
36+
*.la
37+
*.a
38+
*.lib
39+
40+
# Executables
41+
*.exe
42+
*.out
43+
*.app
44+
45+
# A collection of useful .gitignore templates
46+
# https://github.com/github/gitignore
47+
48+
# General
49+
.DS_Store
50+
dir/otherdir/.DS_Store
51+
52+
out/
53+
.vscode/
54+
a.out.dSYM/
55+
56+
# Prerequisites
57+
*.d
58+
59+
# Compiled Object files
60+
*.slo
61+
*.lo
62+
*.o
63+
*.obj
64+
65+
# Precompiled Headers
66+
*.gch
67+
*.pch
68+
69+
# Compiled Dynamic libraries
70+
*.so
71+
*.dylib
72+
*.dll
73+
74+
# Fortran module files
75+
*.mod
76+
*.smod
77+
78+
# Compiled Static libraries
79+
*.lai
80+
*.la
81+
*.a
82+
*.lib
83+
84+
# Executables
85+
*.exe
86+
*.out
87+
*.app
88+
89+
# A collection of useful .gitignore templates
90+
# https://github.com/github/gitignore
91+
92+
# General
93+
.DS_Store
94+
dir/otherdir/.DS_Store
95+
96+
out/
97+
.vscode/
98+
a.out.dSYM/
99+
100+
# Prerequisites
101+
*.d
102+
103+
# Compiled Object files
104+
*.slo
105+
*.lo
106+
*.o
107+
*.obj
108+
109+
# Precompiled Headers
110+
*.gch
111+
*.pch
112+
113+
# Compiled Dynamic libraries
114+
*.so
115+
*.dylib
116+
*.dll
117+
118+
# Fortran module files
119+
*.mod
120+
*.smod
121+
122+
# Compiled Static libraries
123+
*.lai
124+
*.la
125+
*.a
126+
*.lib
127+
128+
# Executables
129+
*.exe
130+
*.out
131+
*.app
132+
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Result
2+
3+
```
4+
5 10 15
5+
2 4 6 8 10
6+
```
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#include <iostream>
2+
#include <new>
3+
4+
void printarray (int arg[], int length) {
5+
for (int n=0; n<length; ++n)
6+
std::cout << arg[n] << ' ';
7+
std::cout << '\n';
8+
}
9+
10+
int main() {
11+
int firstarray[] = {5, 10, 15};
12+
int secondarray[] = {2,4,6,8,10};
13+
printarray(firstarray,3);
14+
printarray(secondarray, 5);
15+
return 0;
16+
}

0 commit comments

Comments
 (0)