dimanche 28 mai 2017

Hash Function " ___ was not declared in this scope"

I'm writing a simple hash table and when trying to implement the hash function

int hash(int key) {
  return key % size;
}

where size is a private member variable in my table class, and hash is a private function. I get an error that says "size was not declared in this scope" I'm not sure what to do since the size of the hash table is supposed to change based off of how many entries the user wants to input (size = entries * 2) so I cant just make it a const variable. Thanks.

Aucun commentaire:

Enregistrer un commentaire