데블스캠프2006/화요일/pointer/문제1/이송희

~cpp
#include <iostream>
using namespace std;

void swap(int *a, int *b);

void main()
{
	int a=1, b=18;

	swap(&a, &b);
	cout << "a=" << a << endl;
	cout << "b=" << b << endl;
}

void swap(int *a, int *b)
{
	int c;
	c=*a;
	*a=*b;
	*b=c;
}
Retrieved from http://wiki.zeropage.org/wiki.php/데블스캠프2006/화요일/pointer/문제1/이송희
last modified 2021-02-07 05:29:06