C#C
C#3y ago
Kit :3

✅ how do i pass /unsafe to dotnet build?

hello everyone! i made a program to convert a float's bits into an int's bits (for fun!) and when i try to build it with dotnet build, it tells me to add /unsafe. no big deal. but when i use dotnet build /unsafe, it tells me that /unsafe isnt valid!

the code im building: (Program.cs)
using System;

namespace thing;

class Program {
    public unsafe static void Main(string[] a) {
        int i = 1000000000;
        Console.WriteLine(*(float*)&i);
    }
}
image.png
Was this page helpful?