Skip to main content

Practice · 3 of 3

Swap through references

CHALLENGE
Difficulty: intermediate+25 XP

Implement void swap_ints(int& a, int& b) exchanging the two caller objects using only references (no pointers, no return).

Back to lesson: Practice: References: borrow and write through