代码改变世界

Compiler Error CS0227: Unsafe code may only appear if compiling with /unsafe

2022-03-07 17:10  ZealouSnesS  阅读(147)  评论(0编辑  收藏  举报

如果想在C# 代码中使用指针,需要在Visual Studio 中,solution exploer -> project 上右键(注意不是 solution 上右键!!!)-> build -> Allow unsafe code 勾选上

 

参考:Compiler Error CS0227 | Microsoft Docs

深入剖析C# 指针 - 编程宝库 (codebaoku.com)