reorganize
This commit is contained in:
3
.gitignore
vendored
3
.gitignore
vendored
@@ -30,3 +30,6 @@
|
|||||||
*.exe
|
*.exe
|
||||||
*.out
|
*.out
|
||||||
*.app
|
*.app
|
||||||
|
|
||||||
|
# Other
|
||||||
|
/.vscode
|
||||||
BIN
Lecture/Week1/main
Executable file
BIN
Lecture/Week1/main
Executable file
Binary file not shown.
25
Lecture/Week1/main.cpp
Normal file
25
Lecture/Week1/main.cpp
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
#include <iostream>
|
||||||
|
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;
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user