/* * ======================================================= * SwapInts() : Swap two integers. Correct implementation. * * Input : int *ipVal1 -- pointer to first integer * argument to be swapped. * : int *ipVal2 -- pointer to second integer * argument to be swapped. * Output : void. * ======================================================= */ void SwapInts( int *ipVal1, int *ipVal2 ) { int iTemp; iTemp = *ipVal1; *ipVal1 = *ipVal2; *ipVal2 = iTemp; } int main( void ) { int iVal1 = 100; int iVal2 = 200; SwapInts( &iVal1, &iVal2 ); }