When would I need to use the stackalloc keyword in C#?

后端 未结 7 946
清歌不尽
清歌不尽 2021-02-05 04:25

What functionality does the stackalloc keyword provide? When and Why would I want to use it?

7条回答
  •  北荒
    北荒 (楼主)
    2021-02-05 04:53

    It is like Steve pointed out, only used in unsafe code context (e.g, when you want to use pointers).

    If you don't use unsafe code in your C# application, then you will never need this.

提交回复
热议问题