Convert a byte array to a bool and display : BitConverter : Development C# Examples


C# Examples » Development » BitConverter »

 

Convert a byte array to a bool and display









    
using  System;
using  System.IO;
  
class  MainClass
{
        public  static  void  Main()  
        {
                byte[]  b  =  null;

                
                b  =  BitConverter.GetBytes(true);

                Console.WriteLine(BitConverter.ToBoolean(b,0));


        }
}
    
   
  
   



Output

True


HTML code for linking to this page:

Follow Navioo On Twitter

C# Examples

 Navioo Development
» BitConverter