Computer Chess Club Archives


Search

Terms

Messages

Subject: Can someone explain this line to me?

Author: TEERAPONG TOVIRAT

Date: 09:28:05 06/30/99


I cannot understand this line in one C++ source code.It's about finding
location in hash table.

    h=hashtable+(h_key.address&(TAB_SIZE/2)-1));

h,hashtable are pointer variables to hash_rec
hash_rec is structure =
 { unsigned long key;
   int score;
   char flag;
   move hmove;
   short id;
}
h_key is a variable of h_code structure
h_code =
{  unsigned long key;
   unsigned long address;
}
TAB_SIZE = unsigned long = 262144

I'm not sure what does "&" mean in this situation?

Thanks in advance,
Teerapong



This page took 0 seconds to execute

Last modified: Thu, 15 Apr 21 08:11:13 -0700

Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.