반응형
#include<stdio.h>
#define SWAP(x,y,t) ((t)=(x),(x)=(y),(y)=(t))
void main()
{
int a = 3, b = 5,t;
printf("%d %d\n", a, b);
SWAP(a, b, t);
printf("%d %d\n", a, b);
}
반응형
'언어 > C' 카테고리의 다른 글
move semantics (0) | 2015.11.25 |
---|---|
c에서 pointer와 swap의 관계 (0) | 2015.06.28 |
MFC Image Viewer (0) | 2015.02.09 |
file 복사 프로그램 (0) | 2015.01.30 |
c File IO (0) | 2015.01.30 |