Conversions : Casting Conversions : Data Types C# Source Code


Custom Search

C# Source Code » Data Types » Casting Conversions »

 

Conversions








    


using System;

public class UNCheckedConversions
{
    public static void Main()
    {
        uint value1 = 312;
        byte value2;
        
        value2 = unchecked((byte) value1);    // never checked
        value2 = (byte) value1;               // checked if /checked
        value2 = checked((byte) value1);      // always checked
    }
}

           
       
    
   
  
   







HTML code for linking to this page:

Follow Navioo On Twitter

C# Source Code

 Navioo Data Types
» Casting Conversions