c# - GetType() on Array item? -


i have initialised array may contain no items.

lets call a,

calling gettype() on a return type of array. possible type of items array contains?

obviously a[0].gettype() work, array empty , cause null reference exception.

well, can element type of array:

type type = array.gettype().getelementtype(); 

(that's not quite same getting types of items in array - object[] may entirely populated strings, example.)


Comments

Popular posts from this blog

c++ - Convert big endian to little endian when reading from a binary file -

C#: Application without a window or taskbar item (background app) that can still use Console.WriteLine() -

unicode - Are email addresses allowed to contain non-alphanumeric characters? -