I have an Type object indicating a primitive data type I want such as
integer, short. How do I dynamically create an array of an primitive type by
using reflection?
Giuseppe Lippolis - 24 Jul 2006 16:09 GMT
Hello Roy,
> I have an Type object indicating a primitive data type I want such as
> integer, short. How do I dynamically create an array of an primitive
> type by using reflection?
Type arrayType=typeof(int).MakeArrayType(5);
object objArray= Activator.CreateIstance(arrayType);