check size with sizeof operator

image_pdfimage_print
   
 
using System;
class MainClass
{
    // unsafe not required for primitive types.
    static void Main()
    {
        Console.WriteLine("The size of short is {0}.", sizeof(short));
        Console.WriteLine("The size of int is {0}.", sizeof(int));
        Console.WriteLine("The size of long is {0}.", sizeof(long));
    }
}