- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to compile unsafe code in C#?
For compiling unsafe code, you have to specify the /unsafe command-line switch with command-line compiler.
For example, to compile a program named one.cs containing unsafe code, from command line, give the command −
csc /unsafe one.cs
Under Visual Studio IDE, enable use of unsafe code in the project properties. The following are the steps −
- Open Project properties by double clicking the properties node in the Solution Explorer.
- Click on the “Build” tab.
- Select the option "Allow unsafe code".

Advertisements