#include void swap( int * x, int * y ) { int tmp = *x; *x = *y; *y = tmp; } int main( void ) { int a = 5, b = 7; swap( &a, &b ); /* must pass the address */ printf( "%d %d\n", a, b ); return 0; }