Related: A list of multiple data types?
I want to know how to store different array types (including system types) inside an array.
The above question covered ho
I know that I'm a little late to the party, but I do this all the time. Especially when I'm initializing new classes. I like to do the heavy lifting outside of my main method, so I use object arrays to handle it. Object[]
lets you put whatever you want into the array. then, when you return the array, you cast the array value to whatever you want. for example:
int NewInt = (int)InitArray[0];
string NewString = (String)InitArray[1];
double NewDouble = (Double)InitArray[2];
That might not be the most elegant solution in all cases, but for the work I do, it certainly handles the single output problem nicely.