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

ruby - When to use an ORM (Sequel, Datamapper, AR, etc.) vs. pure SQL for querying -

php - PHPDoc: @return void necessary? -

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