I am writing a hash class:
struct hashmap { void insert(const char* key, const char* value); char* search(const char* key); private: unsigned int hash(const char* s); hashnode* table_[SIZE];
Since insert () needs to check if table [i] is empty when a new pair is inserted, so I need all the pointers in the table to be set to NULL at startup.
My question is: will this pointer array table_ automatically initialized to zero or should I manually use a loop to set the array to zero in the constructor?
source share