Practice · 1 of 3
Clamp Through a Pointer
CHALLENGE
Difficulty: beginner+25 XP
Implement void clamp_to(int *v, int lo, int hi): if *v is below lo set it to lo; above hi set it to hi; otherwise leave it.
Press Submit to check your solution.
Back to lesson: Practice: Pointer Surgery