// swap.cpp : Defines the entry point for the console application. // #include "stdafx.h" #include "stdlib.h" void swap(int *x, int *y) { int tmp; tmp = *x; *x = *y; *y = tmp; } int _tmain(int argc, _TCHAR* argv[]) { int x = 5; int y = 7; swap(&x, &y); printf("%d %d\n", x, y); system("pause"); }