How to get size of a double data type in C#

1 Answer

0 votes
using System;

namespace ConsoleApplication_C_Sharp
{
    class Program
    {
        static void Main(string[] args)
        {
            int total = sizeof(double);

            Console.WriteLine("{0} bytes ({1} bit) per double", total, total * 8);
        }
    }
}


/*
run:
  
8 bytes (64 bit) per double

*/


 



answered Jan 12, 2017 by avibootz
edited Jan 12, 2017 by avibootz

Related questions

1 answer 158 views
1 answer 163 views
1 answer 171 views
1 answer 165 views
1 answer 157 views
1 answer 149 views
149 views asked Jan 12, 2017 by avibootz
1 answer 147 views
...