C
chrisben
Here are the codes
Queue<string>[] q = new Queue<string>[2];
Console.WriteLine(q[0].Count + "");
The program will crash since q[0] is null.
So my question is that what is the best way for new to initialize the array
with generic queue as the value?
I can do for statement and then do q = new Queue<string>();
But,is there a better way to do it?
Thanks
Chris
Queue<string>[] q = new Queue<string>[2];
Console.WriteLine(q[0].Count + "");
The program will crash since q[0] is null.
So my question is that what is the best way for new to initialize the array
with generic queue as the value?
I can do for statement and then do q = new Queue<string>();
But,is there a better way to do it?
Thanks
Chris