System.Collections.Generic.List<> Array

Hi Experts,

   Is it possible to have an array of System.Collections.Generic.List<> ?  If so, how do you declare it?

   Here is my list:

          public static List<myStructure> myList = new List<myStructure>();

    I tried this:

          public static List<myStructure> [] myList = new List<myStructure>() [2];

    The compiler didn't like that much!

Thanks,
axnst2
axnst2Asked:
Who is Participating?
 
dstanley9Commented:
This compiles fine for me:

public static List<myStructure>[] myList = new List<myStructure>[2];
0
 
dstanley9Commented:
What's the compiler error?
0
 
axnst2Author Commented:
Thanks a bunch, that was it!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.