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


C# Examples » Development » BitConverter »

 

Convert an int to a byte array and display









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

                b  =  BitConverter.GetBytes(3678);
                Console.WriteLine(BitConverter.ToString(b));
        }
}
    
   
  
   



Output

5E-0E-00-00


HTML code for linking to this page:

Follow Navioo On Twitter

C# Examples

 Navioo Development
» BitConverter