Introducing Radical.sh

Forget Code launches a powerful code generator for building API's

SIZEOF( ) in C#

The sizeof( ) operator tells you the number of bytes allocated for data items.

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

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {

           Console.WriteLine(sizeof(int));
           Console.WriteLine(sizeof(short));
           Console.WriteLine(sizeof(float));
           Console.WriteLine(sizeof(long));
           Console.WriteLine(sizeof(double));
           Console.WriteLine(sizeof(decimal));
           Console.WriteLine(sizeof(char));
    }
   }
}


Output:
4
2
4
8
8
16
2


..