C# .net does not allow to pointer in safe mode. If you are use pointer in c# program , then you are declare an entire method as unsafe. steps of compiling unsafe code-
- Go to solution explorer and double click to property.
-select build tab.
-select allow unsafe code and then compile your program.
Example
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace use_pointer_in_c_sharp
{
class Program
{
public static void Main()


Join the conversation! Your thoughts help the community grow.