OverflowCheck

image_pdfimage_print
   
 

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);
    }
}

    


This entry was posted in Data Types. Bookmark the permalink.