Thread: convert c string to int

  1. #16
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,897
    >how do I initialize a hash file???
    Hopefully the file already exists, but we're basically talking about a binary file where every record is exactly the same size. This way you can calculate an offset with the hash function.

    >Also, do I still need to use an array of any sort or not with hash files?
    You only need to work with a single record at a time, so no.

    -Prelude
    My best code is written with the delete key.

  2. #17
    Registered User
    Join Date
    Sep 2002
    Posts
    64
    can i still use the hash function you gave me ?

  3. #18
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,897
    >can i still use the hash function you gave me ?
    Of course. The only real difference between a hash table and a hash file is how you access the data. The actual hashing part remains the same throughout.

    -Prelude
    My best code is written with the delete key.

  4. #19
    Registered User
    Join Date
    Sep 2002
    Posts
    64
    I hate to keep bothering, but how do I deal with collissions now.

    I have set up a while loop to go through the entire file, and I read on record at a time and hash it. how can i deal with collissions within in my while loop???

    that will be the last of my questions!

  5. #20
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,897
    >how can i deal with collissions within in my while loop???
    Since you are using linear probing you don't have to make any changes, handle collisions the same way: If your hashed index is already taken, move to the next one until you find an empty index.

    -Prelude
    My best code is written with the delete key.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. how to combine these working parts??
    By transgalactic2 in forum C Programming
    Replies: 0
    Last Post: 02-01-2009, 08:19 AM
  2. Replies: 8
    Last Post: 04-25-2008, 02:45 PM
  3. Debug Error Really Quick Question
    By GCNDoug in forum C Programming
    Replies: 1
    Last Post: 04-23-2007, 12:05 PM
  4. Half-life SDK, where are the constants?
    By bennyandthejets in forum Game Programming
    Replies: 29
    Last Post: 08-25-2003, 11:58 AM
  5. Quack! It doesn't work! >.<
    By *Michelle* in forum C++ Programming
    Replies: 8
    Last Post: 03-02-2003, 12:26 AM