Part 6 in a series on new language features in C# 12.

C# logo

Inline arrays

Super-niche, but I guess if you need it, you’ll appreciate it. Previously you’d probably need to resort to using unsafe code to deal with this.

public struct InlineArray
    public int Thing;

The compiler now knows this is an array of 10 contiguous elements.

Further reading

Example source