diff --git a/.gitignore b/.gitignore index 259148f..4d3a4b5 100644 --- a/.gitignore +++ b/.gitignore @@ -30,3 +30,6 @@ *.exe *.out *.app + +# Other +/.vscode \ No newline at end of file diff --git a/Lecture/Week1/main b/Lecture/Week1/main new file mode 100755 index 0000000..faa6d0f Binary files /dev/null and b/Lecture/Week1/main differ diff --git a/Lecture/Week1/main.cpp b/Lecture/Week1/main.cpp new file mode 100644 index 0000000..013b05b --- /dev/null +++ b/Lecture/Week1/main.cpp @@ -0,0 +1,25 @@ +#include +using namespace std; +/* +void swap(int x, int y) { + int temp = x; + x = y; + y = temp; +} +*/ + +void swap(int* x, int* y) { + int temp = *x; + *x = *y; + *y = temp; +} + +int main() { + int A = 2; + int B = 8; + // Pass in addresses to be + swap(&A,&B); + cout << "A: " << A << " B: " << B << endl; + + return 0; +} \ No newline at end of file diff --git a/makefile b/Lecture/Week1/makefile similarity index 100% rename from makefile rename to Lecture/Week1/makefile diff --git a/math.cpp b/Lecture/Week1/math.cpp similarity index 100% rename from math.cpp rename to Lecture/Week1/math.cpp diff --git a/math.h b/Lecture/Week1/math.h similarity index 100% rename from math.h rename to Lecture/Week1/math.h diff --git a/main.cpp b/main.cpp deleted file mode 100644 index e69de29..0000000