Skip to main content

Practice ยท 3 of 3

Ownership Transfer

CHALLENGE
Difficulty: beginner+25 XP

Implement int* take(int **slot) that returns the pointer currently in *slot and sets *slot to NULL โ€” handing ownership to the caller without leaving a dangling alias.

Back to lesson: Practice: Ownership Discipline