Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

c# bool to int

bool t = true;
bool f = false;

var a = Unsafe.As<bool, int>(ref t);
var b = Unsafe.As<bool, int>(ref f);

Console.WriteLine(a); // 1
Console.WriteLine(b); // 0
 
PREVIOUS NEXT
Tagged: #bool #int
ADD COMMENT
Topic
Name
5+6 =