I dont think this is possible in c# but ill post it anyway.
Given my code
Control ctrlA = null, ctrlB = null;
var ctrlCollection = new []{ctrlA, ctrlB};
for (int i = 0; i < ctrlCollection.length;i++)
ctrlCollection[i] = new Control();
Is it possible to to construct these two objects and have them referenced to their respective variables (ctrlA and ctrlB)? As it stands, ctrlA and ctrlB will still have null references.
No, it’s not. (at least, not unless you want to work with pointers or something) Will this work for you?