Challenge 2: Swap Values

Let's try to swap the values of two pointers.

We'll cover the following

Problem Statement

You must implement the swapVals function which takes in two pointers and swaps the values they point to. The pointers should be of the integer type.

*p = 10
*q = 20
swap(p, q)
*p == 20
*q == 10

Get hands-on with 1400+ tech skills courses.