Write a function that swaps the values of two integers, using int* as the argument type.

Q

Write a function that swaps the values of two integers, using int* as the argument type.

✍: Guest

A
void swap(int* a, int*b) {
   int t;
   t = *a;
   *a = *b;
   *b = t;
}

2012-01-31, 2804👍, 0💬