OverflowCheck : checked unchecked : Data Types C# Source Code


Custom Search

C# Source Code » Data Types » checked unchecked »

 

OverflowCheck








    
 

using System;
using System.Collections.Generic;
using System.Text;

class Program {
    static void Main(string[] args) {
        byte destinationVar;
        short sourceVar = 281;
        destinationVar = checked((byte)sourceVar);
        Console.WriteLine("sourceVar val: {0}", sourceVar);
        Console.WriteLine("destinationVar val: {0}", destinationVar);
    }
}

 
    
   
  
   







HTML code for linking to this page:

Follow Navioo On Twitter

C# Source Code

 Navioo Data Types
» checked unchecked