Using Hash Tables

Dictionaries are collections that let you store values that are indexed by keys, not index numbers. For example, say you wanted to create a data record for each of your customers. You could store each customer's record using an array of values, but then you have to remember that index 0 in the array holds the customer's name, index 2 holds the address, index 3 the phone number, and so on. It is easier to index those values with text string keys like "Name", "Address", "Phone", and so on, and that's what dictionaries let you do. In fact, in .NET, you can use any kind of key—an integer, object, float, string, and so on—with any kind of value—an integer, object, float, string, and so on.

Hash tables are dictionaries that are highly ...

Get Microsoft® Visual C#® .NET 2003 Kick Start now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.