タグ

softwareとCS0227に関するItisangoのブックマーク (1)

  • コンパイラ エラー CS0227 - C#

    アンセーフ コードは /unsafe でコンパイルした場合のみ有効です。 ソース コードに unsafe キーワードが含まれている場合、AllowUnsafeBlocks コンパイラ オプションも使用する必要があります。 詳細については、「アンセーフ コードとポインター」を参照してください。 Visual Studio 2012 で unsafe オプションを設定するには、メイン メニューで [プロジェクト] をクリックして、 [ビルド] ウィンドウを選択し、[アンセーフ コードの許可] チェック ボックスをオンにします。 次の例で、 /unsafe なしでコンパイルすると、CS0227 が生成されます。 // CS0227.cs public class MyClass { unsafe public static void Main() // CS0227 { } } 関連項目 C#

    Itisango
    Itisango 2020/10/26
    "If source code contains the unsafe keyword, then the -unsafe compiler option must also be used. For more information, see Unsafe Code and Pointers. To set the unsafe option in Visual Studio 2012, click on Project in the main menu, select the Build pane, and check the box that says..." #dotNET
  • 1