Toggle menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

데블스캠프2006/화요일/pointer/문제1/이장길

From ZeroWiki
#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