Skip to main content
Journey Uncommon Logo
JourneyUncommon
hardC#ref struct and ref returnsSingle-choice MCQ

Consider this `ref` reassignment. After the loop, which statement correctly describes what happened at the machine level?

int[] arr = { 1, 2, 3 }; ref int current = ref arr[0]; for (int i = 0; i < arr.Length; i++) { current = ref arr[i]; current += 10; } // arr is now { 11, 12, 13 }