Search
 
SCRIPT & CODE EXAMPLE
 

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
Comment

PREVIOUS NEXT
Code Example
Csharp :: vb.net check if datatable has rows 
Csharp :: listview imagelist c# 
Csharp :: c# write iformfile 
Csharp :: singleton pattern c# 
Csharp :: distance between two objects unity 2d 
Csharp :: c# math method to reverse negative or positive 
Csharp :: unity detect when an object has been clicked 
Csharp :: unity reflect raycast 
Csharp :: serilog .net 6 
Csharp :: c# creating an array 
Csharp :: unity rb.addexplosionforce 2d 
Csharp :: how to decrease velocity of a Unity rigidbody 
Csharp :: Printing pattern in c# 
Csharp :: audio unity 
Csharp :: get position of another object unity 
Csharp :: c# .equals vs == 
Csharp :: context.Response.Body read stream .net 
Csharp :: render world space UI infront of everything unity 
Csharp :: update browserslist 
Csharp :: linq c# object except two lists 
Csharp :: Rotating an object in Unity usign Physics 
Csharp :: Startup.cs class is missing in .NET 6 
Csharp :: create blazor server 
Csharp :: Convert integers to written numbers C# 
Csharp :: c# mongodb count documents 
Csharp :: get current location latitude and longitude in xamarin - NAYCode.com 
Csharp :: C# get filebase name 
Csharp :: do while loop in c# 
Csharp :: check if list contains any empty element in c# 
Csharp :: how to insert data into multiple tables using asp.net c# 
ADD CONTENT
Topic
Content
Source link
Name
8+6 =