Mega Code Archive

 
Categories / C# Book / 09 Reflection
 

0618 ref and out parameter type names

A <code>Type</code> describing a ref or out parameter has an & suffix: using System; using System.Reflection; using System.Collections.Generic; class MainClass { static void Main() { Type t = typeof(bool).GetMethod("TryParse").GetParameters()[1].ParameterType; Console.WriteLine(t.Name); // Boolean& } } The output: Boolean&