Data structure

This is a discussion on Data structure within the C# Programming forums, part of the General Programming Boards category; What is a good built in data structure for storing a few numbers or characters. I was looking at linked ...

  1. #1
    Registered User mrafcho001's Avatar
    Join Date
    Jan 2005
    Posts
    483

    Data structure

    What is a good built in data structure for storing a few numbers or characters.

    I was looking at linked lists but i dont know how to retrieve teh data.

    What im really looking for is something like the vectors in C++.
    My Website
    010000110010101100101011
    Add Color To Your Code!

  2. #2
    Registered User
    Join Date
    Sep 2004
    Location
    California
    Posts
    3,255
    Try an ArrayList.

    Code:
    ArrayList a = new ArrayList();
    a.Add(3);
    a.Add(1);
    a.Add(4);
    
    int i = (int)a[1];

  3. #3
    Registered User mrafcho001's Avatar
    Join Date
    Jan 2005
    Posts
    483
    Thanks, but I changed the code around a bit and made it work with a normal array.

    However I will be changing it since i want something that can dynamicly change size.
    My Website
    010000110010101100101011
    Add Color To Your Code!

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Include GTK+ just for a data structure?
    By Jesdisciple in forum C Programming
    Replies: 0
    Last Post: 04-12-2009, 08:19 PM
  2. pthread question how would I init this data structure?
    By mr_coffee in forum C Programming
    Replies: 2
    Last Post: 02-23-2009, 12:42 PM
  3. Data structure implementation
    By fkheng in forum C Programming
    Replies: 3
    Last Post: 07-31-2003, 08:44 AM
  4. can't insert data into my B-Tree class structure
    By daluu in forum C++ Programming
    Replies: 0
    Last Post: 12-05-2002, 06:03 PM
  5. Tab Controls - API
    By -KEN- in forum Windows Programming
    Replies: 7
    Last Post: 06-02-2002, 10:44 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21