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


C# Examples » Data Type » Data Type Cast »

 

cast a long into a uint, data lost









    
using  System;  
  
class  Example  {        
    public  static  void  Main()  {        
        uint  u;  
        long  l;  
  
        //  cast  a  long  into  a  uint,  data  lost  
        l  =  -12;  
        u  =  (uint)  l;  
        Console.WriteLine("u  after  assigning  -12:  "  +  u  +  
                                            "  --  data  lost.");    
    }
}
    
   
  
   



Output

u after assigning -12: 4294967284 -- data lost.


HTML code for linking to this page:

Follow Navioo On Twitter

C# Examples

 Navioo Data Type
» Data Type Cast