От: | alexzzzz | ||
Дата: | 14.01.20 17:30 | ||
Оценка: |
using System;
class Program
{
static void Main()
{
Print(typeof(int));
Print(typeof(int*));
Print(typeof(int[]));
}
static void Print(Type type)
{
Console.WriteLine($"{type.Name} is a value-type: {type.IsValueType}");
Console.WriteLine($"{type.Name} is a pointer-type: {type.IsPointer}");
Console.WriteLine($"{type.Name} is a reference-type: {type.???}"); // <----- ???
Console.WriteLine();
}
}
Gets a value indicating whether the Type is passed by reference.
Remarks
To get to the actual type, dereference the type that was passed by reference, and then call GetElementType on that type.