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

The method below does not compile. What is the precise reason the C# compiler rejects it?

ref int GetRef() { int local = 42; return ref local; }