using System; //csc /unsafe unsafe_method.cs class ex_unsafe { public unsafe static void showsize() { Console.WriteLine("The size of sbyte : " + sizeof(sbyte)); Console.WriteLine("The size of byte :" + sizeof(byte)); Console.WriteLine("The size of shot :" + sizeof(short)); Console.WriteLine("The size of ushort :" + sizeof(ushort)); Console.WriteLine("The size of int :" + sizeof(int)); Console.WriteLine("The size of uint :" + sizeof(uint)); Console.WriteLine("The size of long :" + sizeof(long)); Console.WriteLine("The size of ulong :" + sizeof(ulong)); Console.WriteLine("The size of char :" + sizeof(char)); Console.WriteLine("The size of float :" + sizeof(float)); Console.WriteLine("The size of double :" + sizeof(double)); Console.WriteLine("The size of bool :" + sizeof(bool)); } } class test { static void Main() { ex_unsafe.showsize(); } } |