C# Type MakeByRefType

Description

Type MakeByRefType returns a Type object that represents the current type when passed as a ref parameter (ByRef parameter in Visual Basic).

Syntax

Type.MakeByRefType has the following syntax.


public virtual Type MakeByRefType()

Returns

Type.MakeByRefType method returns A Type object that represents the current type when passed as a ref parameter (ByRef parameter in Visual Basic).

Example

The following code example creates array, ref (ByRef in Visual Basic), and pointer types for the Test class.


/*from   w w  w .j  a v a  2 s . c  o  m*/
using System;
using System.Reflection;

public class Example
{
    public static void Main()
    {
        Type t = typeof(Example).MakeArrayType();
        t = typeof(Example).MakeByRefType();
        Console.WriteLine("\r\nByRef Example: {0}", t);

    }
}

The code above generates the following result.





















Home »
  C# Tutorial »
    System »




Array
BitConverter
Boolean
Byte
Char
Console
ConsoleKeyInfo
Convert
DateTime
DateTimeOffset
Decimal
Double
Enum
Environment
Exception
Guid
Int16
Int32
Int64
Math
OperatingSystem
Random
SByte
Single
String
StringComparer
TimeSpan
TimeZone
TimeZoneInfo
Tuple
Tuple
Tuple
Type
UInt16
UInt32
UInt64
Uri
Version