Categories

Dec 8, 2019 in Dot Net
Q: Stackalloc in nested expressions in C#

1 Answer

Dec 8, 2019

Starting with C# 8.0, if the result of a stackalloc expression is of the System.Span<T> or System.ReadOnlySpan<T> type, you can use the stackalloc expression in other expressions:

Span<int> numbers = stackalloc[] { 1, 2, 3, 4, 5, 6 }; var ind = numbers.IndexOfAny(stackalloc[] { 2, 4, 6 ,8 }); Console.WriteLine(ind); // output: 1

Click here to read more about Loan/Mortgage
Click here to read more about Insurance

Related questions

Madanswer
Dec 8, 2019 in Dot Net
Dec 8, 2019 in Dot Net
Dec 8, 2019 in Dot Net
...