diff options
author | Oskar <[email protected]> | 2024-09-05 11:30:53 +0200 |
---|---|---|
committer | Oskar <[email protected]> | 2024-09-05 11:30:53 +0200 |
commit | 689b333897de2197e5d6f65c4e7de62cf68334ff (patch) | |
tree | d97ca016c3a439f14167aa665e88458c967624e3 | |
parent | d2f183b8d0008bdb29e6c5c4fa04c14d7525ca9b (diff) |
more
-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; +} |