Skip to main content

Practice ยท 2 of 3

Swap with a Temp

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".)

Difficulty: beginner

Back to lesson: Practice: Value Surgery