Skip to main content
Journey Uncommon Logo
JourneyUncommon
hardC#boxing and unboxing costSingle-choice MCQ

What does this loop actually do in terms of heap allocations, and what is the hidden per-iteration cost?

for (int i = 0; i < n; i++) { int x = i; Console.WriteLine("{0}", x); }