In the event that you do decide to make use of this C# language feature, you will be required to
inform the C# compiler (csc.exe) of your intentions by enabling your project to support “unsafe
code.” To do so at the command line, simply supply the /unsafe flag as an argument:
csc /unsafe *.cs
From Visual Studio 2008, you will need to access your project’s Properties page and check the
Allow Unsafe Code check box from the Build tab (see Figure 12-7). To experiment with pointer
types, create a new Console Application project named UnsafeCode and enable unsafe code.
Figure 12-7.
Enabling unsafe code using Visual Studio 2008
Do'stlaringiz bilan baham: