#include typedef float * floatptr; void swapfloats(floatptr a, floatptr b) { float temp; /* This is still float, because we are swapping floats */ temp = *a; /* Note the '*'s - get the float pointed to by a. */ *a = *b; /* Copy the float b points at into the variable a points at*/ *b = temp; /* Copy the float in temp into the variable b points at. */ } main() { float first=2, second=1; swapfloats(&first,&second); /* Note the 'address-of' operators */ printf("%f %f\n", first, second); return 0; }