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

고한종/swap(): Difference between revisions

From ZeroWiki
imported>jereneal20
No edit summary
imported>rino0601@naver.com
No edit summary
 
Line 1: Line 1:
[[고한종]]
  #include <stdio.h>
  #include <stdio.h>
   
   

Latest revision as of 07:08, 22 May 2011

고한종

#include <stdio.h>

void swap(int *a, int *b)
{
	int temp;
	temp = *a;
	*a = *b;
	*b = temp;
}

int main()
{
	int a=3 , b=5;
	printf("%d,%d\n",a,b);
	printf("%d,%d\n",&a,&b);
	swap(&a,&b);
	printf("%d,%d\n",a,b);
	printf("%d,%d\n",&a,&b);

	return 0;
}

댓글

뭔가 설명을 달어