View Single Post
Old Dec 27th, 2006, 10:57 AM   #1
kruptof
Professional Programmer
 
kruptof's Avatar
 
Join Date: May 2006
Location: UK - London
Posts: 333
Rep Power: 3 kruptof is on a distinguished road
checking str*[] against NULL

When testing if something is NULL does it mean to see if something exists in that memory location, if that is (if not then please do explain) so then why is that am getting an error when i try to see if a struct*[] != NULL. here is the error that i have received.

error C2676: binary '!=' : 'HashTable' does not define this operator or a conversion to a type acceptable to the predefined operator


struct HashTable
{
	int age;
	static HashTable* table[5];
	HashTable* next;
	int createHash(char*, int);
	void insert(int,int);
};
HashTable* HashTable::table[5];

void HashTable::insert(int position, int data)
{
	if((*table)[position] != NULL)//error is on this line
	{
		HashTable* current = new HashTable;
	}

}
__________________
Quote:
When I was young it seemed that life was so wonderful,a miracle, oh it was beautiful, magical.
Now watch what you say or they'll be calling you a radical,a liberal, oh fanatical, criminal. Oh won't you sign up your name,we'd like to feel you're acceptable, respectable, oh presentable, a vegetable
kruptof is offline   Reply With Quote