Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

C# 

C# Hashtables [Intermediate Level Tutorial]

I wouldn't start use hashtables like this, but thats ur way in coding style.
Maybe u should start explain about certain arrays and other collection types.
You could have done this much easier, but good guide anyway :)
all types of arrays should be declared after use, else they can send alot random null reference exceptions.
hashtables can keep the data for longer time + they can keep more.
Well I dont wanna go deeper in it, if u dont want me to, then I will explain it total out, because this wont explain much, if u dont know about it already.
Example on arraylist.
Code
static void Main(string[] args)
  {
    //Use ararylists temp only, else u will get random errors (null exception eg.)
    //Make sure u copy to a real array, because arraylists are to hold less data
    ArrayList list = new ArrayList();
    Random random = new Random();
    for (int i = 0; i < random.Next(0, 1000); i++)
    {
    list.Add(i);
    }
    int[] buffer = new int[list.Count];
    list.CopyTo(buffer);
    foreach (int i2 in buffer)
    {
    Console.WriteLine(i2);
    }
  }

more u want?


Possibly Related Threads...
Thread / Author Replies Views Last Post
[C#] by dummycartSep 9, 2021 03:38 AM 1 146 Sep 9, 2021 03:38 AM
Last Post: Lindros
[Python] by CiataLearnerDec 22, 2018 02:27 PM 1 212 Dec 22, 2018 02:27 PM
Last Post: notjapanese
[C] by Adam2017Dec 3, 2018 03:06 PM 2 167 Dec 3, 2018 03:06 PM
Last Post: Adam2017