#include <stdio.h>
void NewSwap(int *firstVal, int *secondVal);
main()
{
int valueA = 3;
int valueB = 4;
printf("Before NewSwap: valueA = %d and valueB = %d\n", valueA, valueB);
NewSwap(&valueA, &valueB);
printf("After NewSwap : valueA = %d and valueB = %d\n", valueA, valueB);
}
void NewSwap(int *firstVal, int *secondVal)
{
int tempVal; /* Needed to hold firstVal when swapping */
tempVal = *firstVal;
*firstVal = *secondVal;
*secondVal = tempVal;
}