Practice · 1 of 4
Copy vs reference
CHALLENGE
Difficulty: advanced+25 XP
Implement static (int, int) Twist() that: creates a struct point (3,4), assigns it to a second variable, mutates the second to (10,20), and returns the FIRST point's coordinates. Structs copy on assignment — the first must be untouched.
Press Submit to check your solution.
Back to lesson: Practice: Semantics under the microscope