C# Type MakePointerType
Description
Type MakePointerType
returns a Type object that represents
a pointer to the current type.
Syntax
Type.MakePointerType
has the following syntax.
public virtual Type MakePointerType()
Returns
Type.MakePointerType
method returns A Type object that represents a pointer to the current type.
Example
The following code example creates array, ref (ByRef in Visual Basic), and pointer types for the Test class.
//from w w w. ja va 2s . c o m
using System;
using System.Reflection;
public class Example
{
public static void Main()
{
Type t = typeof(Example).MakeArrayType();
t = typeof(Example).MakePointerType();
Console.WriteLine("\r\nPointer to Example: {0}", t);
}
}
The code above generates the following result.