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


C# Examples » Development » BitConverter »

 

Convert a bool to a byte array and display









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

                
                b  =  BitConverter.GetBytes(true);
                Console.WriteLine(BitConverter.ToString(b));

        }
}
    
   
  
   



Output

01


HTML code for linking to this page:

Follow Navioo On Twitter

C# Examples

 Navioo Development
» BitConverter