#include	<stdio.h>

/* no_swap()'s parameters are of type "integer" */
void
no_swap(int a, int b)
{
	int	tmp = a;
	a = b;
	b = tmp;
	printf("At end of no_swap():        a = %d, b = %d\n", a, b);
}

/* swap()'s parameters are of type "pointer to integer" */
void
swap(int *a, int *b)
{
	int	tmp = *a;
	*a = *b;
	*b = tmp;
	printf("At end of swap():          *a = %d,*b = %d\n", *a, *b);
}

int
main()
{
	int	a = 1, b = 2;

	printf("Originally:                 a = %d, b = %d\n", a, b);

	/* Pass integers */
	no_swap(a, b);
	printf("After return from no_swap() a = %d, b = %d\n", a, b);

	/* Pass pointers to integers */
	swap(&a, &b);
	printf("After return from swap()    a = %d, b = %d\n", a, b);

	return 0;
}
