-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathswap.c
29 lines (18 loc) · 815 Bytes
/
swap.c
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
/**************************************************************************
* geom.c - geometry problem that works with dynamically allocated arrays *
**************************************************************************/
#include <stdio.h>
void swap(int *num1, int *num2);
int main() {
int num1, num2;
// TO DO: assign values to num1 and num2
// TO DO: print the "before" values of num1 and num2
// TO DO: call swap (passing in the memory addresses for num1 and num2 ... hint "&")
// TO DO: print the "after" values of num1 and num2
return 0;
}
// TO DO: implement the function below
// HINT: create a local variable named "tmp" as part of your swapping algorithm
// SECOND HINT: when doing the actual swapping, be sure to dereference the pointers!
void swap(int *num1, int *num2) {
}