Solved

System.Collections.Generic.List<>  Array

Posted on 2006-06-21
3
190 Views
Last Modified: 2010-04-16
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
0
Comment
Question by:axnst2
  • 2
3 Comments
 
LVL 25

Expert Comment

by:dstanley9
ID: 16952917
What's the compiler error?
0
 
LVL 25

Accepted Solution

by:
dstanley9 earned 500 total points
ID: 16952933
This compiles fine for me:

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

Author Comment

by:axnst2
ID: 16953505
Thanks a bunch, that was it!
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Introduction This article series is supposed to shed some light on the use of IDisposable and objects that inherit from it. In essence, a more apt title for this article would be: using (IDisposable) {}. I’m just not sure how many people would ge…
Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now