C
C#2y ago
Matto58

✅ 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);
}
}
using System;

namespace thing;

class Program {
public unsafe static void Main(string[] a) {
int i = 1000000000;
Console.WriteLine(*(float*)&i);
}
}
4 Replies
333fred
333fred2y ago
C# Compiler Options - language feature rules
C# Compiler Options for language feature rules. These options control how the compiler interprets certain language constructs.
Matto58
Matto58OP2y ago
thanks!
333fred
333fred2y ago
Yw
Matto58
Matto58OP2y ago
now it builds! :D
Want results from more Discord servers?
Add your server