Compiling Unsafe Code
suggest changeTo compile unsafe code, pass the /unsafe switch to the command-line compiler.
For example, to compile a program named prog1.cs that contains unsafe code, run:
csc /unsafe prog1.cs
In Visual Studio, enable unsafe code in the project properties.
To do this:
- Open project properties by double clicking the properties node in the Solution Explorer.
- Click on the Build tab.
- Select the option “Allow unsafe code”
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents