~cpp
#include <iostream.h>

void swap(int *, int *);

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

	cout << "a = " << a;
	cout << "b = " << b << endl;

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

}

void swap(int *n, int *m)
{
	int save;

	save = *n;

	*n = *m;
	*m = save;

}



----
데블스캠프2006/화요일/pointer
Retrieved from http://wiki.zeropage.org/wiki.php/데블스캠프2006/화요일/pointer/문제1/이장길
last modified 2021-02-07 05:29:06