Permalink
Fetching contributors…
Cannot retrieve contributors at this time
67 lines (55 sloc) 1.65 KB
title ms.date ms.prod ms.technology ms.topic f1_keywords dev_langs helpviewer_keywords ms.assetid caps.latest.revision author ms.author translation.priority.ht
-unsafe (C# Compiler Options)
2015-07-20
.net
devlang-csharp
article
/unsafe
CSharp
-unsafe compiler option [C#]
unsafe compiler option [C#]
/unsafe compiler option [C#]
fdb77ed9-da03-45bd-bb7f-250704da1bcc
19
BillWagner
wiwagn
cs-cz
de-de
es-es
fr-fr
it-it
ja-jp
ko-kr
pl-pl
pt-br
ru-ru
tr-tr
zh-cn
zh-tw

/unsafe (C# Compiler Options)

The /unsafe compiler option allows code that uses the unsafe keyword to compile.

Syntax

/unsafe  

Remarks

For more information about unsafe code, see Unsafe Code and Pointers.

To set this compiler option in the Visual Studio development environment

  1. Open the project's Properties page.

  2. Click the Build property page.

  3. Select the Allow Unsafe Code check box.

For information about how to set this compiler option programmatically, see xref:VSLangProj80.CSharpProjectConfigurationProperties3.AllowUnsafeBlocks%2A.

Example

Compile in.cs for unsafe mode:

csc /unsafe in.cs  

See Also

C# Compiler Options
Managing Project and Solution Properties