Declaring an array of linked list in C#

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • complete
    New Member
    • Aug 2006
    • 11

    #1

    Declaring an array of linked list in C#

    Declaring an array of linked list in C#

    How do I declare an array of some class in C#? I wonder if it is even allowed or possible.

    I got the compile error message "Array size cannot be specified in a variable declaration (try initializing with a 'new' expression)" when I tried to declare an array of linked lists.

    public LinkedList<Leve lNode>[2] ExistingXMLList ;

    Also, if I wanted to create a small array of strings, isn't this the way:

    string [2] inputdata;
  • tlhintoq
    Recognized Expert Specialist
    • Mar 2008
    • 3532

    #2
    You really need to go look at MSDN for arrays.

    http://msdn.microsoft.com/en-us/libr...53(VS.71).aspx

    Let Me Google That For You (LMGTFY): for all those people who find it more convenient to bother you with their question rather than search it for themselves.


    Let me suggest that right now you just STOP, think, and make a choice about your future.
    • Are you going to be the person who asks everyone for the answer and do your research for you?
    • Or are you going to be someone who actively controls their education and marketable job skills?
    • Are you going to be the so-so coder that gets dumped the crap jobs that better skilled people don't want?
    • Or are you going to CHOOSE to excel at what you do and get whatever good gig you want?
    • Are you going to be the person to cries "I don't know, someone tell me the answer"?
    • Or are you going to be the person who says "Everything I learn is another dollar I earn"?

    Do you want to be common or exceptional? It's entirely your choice, and you make that choice by making an effort in your education and work ethic.

    While you are making that decision, let me give you a hint:
    My programming skills sent me to these places at the company expense:
    Chitzen Itza
    Australia
    New Zealand, Singapore, Malaysia, Fiji, Dubai, Finland, Beruit
    Panaramic Alaska
    ...And not because I was the guy too lazy to google. Or because I was the guy that would rather watch "My name is Earl" and "Survivor 15" instead of spending my own free time at night reading programming text books.

    Comment

    Working...