diff options
Diffstat (limited to '6p10.cpp')
-rw-r--r-- | 6p10.cpp | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/6p10.cpp b/6p10.cpp new file mode 100644 index 0000000..fbe8218 --- /dev/null +++ b/6p10.cpp @@ -0,0 +1,26 @@ +#include <iostream> + +/* + * + * 6.10 + * + * + */ + +void intswapper(int *i1, int *i2) { + + int tmp1 = *i1; + int tmp2 = *i2; + *i1 = tmp2; + *i2 = tmp1; +} + +int main () { + + int i1 = 7372; + int i2 = 8282; + std::cout << "i1: " << i1 << "\ni2: " << i2 << std::endl; + intswapper(&i1, &i2); + std::cout << "i1: " << i1 << "\ni2: " << i2 << std::endl; + return 0; +} |