Convert numeric types explicit to 'smaller' types : Data Type : Data Type C# Examples


C# Examples » Data Type » Data Type »

 

Convert numeric types explicit to 'smaller' types









    
class  MainClass
{
        public  static  void  Main()
        {
                //  all  implicit
                sbyte  v  =  55;
                short  v2  =  v;
                int  v3  =  v2;
                long  v4  =  v3;
                
                //  explicit  to  "smaller"  types
                v3  =  (int)  v4;
                v2  =  (short)  v3;
                v  =  (sbyte)  v2;
        }
}
    
   
  
   




HTML code for linking to this page:

Follow Navioo On Twitter

C# Examples

 Navioo Data Type
» Data Type