Practice · 2 of 3
Swap with a Temp
CHALLENGE
Difficulty: beginner+25 XP
Implement void swap(int* a, int* b) that exchanges the two ints through the pointers using a temporary. (Full pointer theory comes in module 11; for now the pattern *a means "the int a points at".)
Press Submit to check your solution.
Back to lesson: Practice: Value Surgery