How to create an array of custom type in C#? -
i created object array different types of elements in them: public static int a; public static string b; public static ushort c; object[] myobj = new obj[]{ a, b, c}; if want create array contains elements of arrays of myobj type, how it? i mean this: myobj[] myarray = new myobj[]; <= this, myobj should type. not sure how work out. thanks everyone. how use dictionary store types need? so, while not have mytype.a , can have mytype.values["a"] , close enough, makes use of standard c# constructs, , gives lots of flexibility/maintainability public class mytype { public mytype() { this.values = new dictionary<object, object>(); } public dictionary<object, object> values { get; set; } } and sample usage: using system; using system.collections.generic; public static class program { [stathread] private static void main() { var mytypes = new mytype[3]; myt...