C# How to get variable data type?
<p>So what I want is to find out what data type is some variable holding.</p>

<p>I have something like this now:</p>

<pre><code>using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Testing
{
    class Program
    {
        static void Main()
        {
            Person someone = new Person();
            someone.setName(22);
            int n = someone.getName();
            Console.WriteLine(n.typeOf());
        }
    }

    class Person
    {
        public int name;

        public void setName(int name)
        {
            this.name = name;
        }

        public int getName()
        {
            return this.name;
        }
    }
}
</code></pre>

<p>So how can I find out what data type is some variable holding? Is it int, string, char...?
Im moving away from PHP and learning about C# so Im confused with static typing and thinking about data types.
Thanks!</p>
