mirror of
https://github.com/VictorEijkhout/TheArtOfHPC_vol3_cppf08programming.git
synced 2026-01-24 22:44:48 +09:00
20 lines
239 B
C++
20 lines
239 B
C++
// code by Akhil Sadam
|
|
|
|
#include <iostream>
|
|
using namespace std;
|
|
|
|
void swap(int* i,int* j)
|
|
{
|
|
int* tmp = i;
|
|
i = j;
|
|
j = tmp;
|
|
}
|
|
|
|
int main()
|
|
{
|
|
int i=1,j=2;
|
|
swap(*&i,*&j);
|
|
cout << i << " " << j << '\n';
|
|
return 0;
|
|
}
|