Cast a long into a uint, no data lost : Data Type Cast : Data Type C# Examples


C# Examples » Data Type » Data Type Cast »

 

Cast a long into a uint, no data lost









    
using  System;  
  
class  Example  {        
    public  static  void  Main()  {        
        uint  u;  
        long  l;  
  
        l  =  64000;  
        u  =  (uint)  l;  
        Console.WriteLine("u  after  assigning  64000:  "  +  u  +  
                                            "  --  no  data  lost.");    
  
    }
}
    
   
  
   



Output

u after assigning 64000: 64000 -- no data lost.


HTML code for linking to this page:

Follow Navioo On Twitter

C# Examples

 Navioo Data Type
» Data Type Cast