View Single Post
Old Dec 27th, 2006, 11:28 AM   #2
DaWei
Resident Grouch
 
DaWei's Avatar
 
Join Date: Jun 2005
Posts: 6,453
Rep Power: 10 DaWei is on a distinguished road
You're getting the error because you haven't defined a != operator for a HashTable (which is what your message says, right?). table [position] is a pointer, but if you dereference it, you're referring to a HashTable. You should test the pointer for NULL before you dereference it.

As for NULL, it's implementation defined. There's a good chance it's zero. Every location in memory has something in it. It's a piece of hardware that has bit cells that can only contain the states, 0 and 1 (except for a short period of time when it's transitioning between the two). There is no "nothing"; there's just an agreement that some "something" will represent "nothing".
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code.
Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers
DaWei is offline   Reply With Quote