struct hashlistnode<_Key,_Val> * bin = table[i];
while(bin!=NULL) {
struct hashlistnode<_Key,_Val> * next=bin->next;
- _free(bin);
+ delete bin;
bin=next;
}
}
struct hashlistnode<_Key,_Val> * bin = table[i];
while(bin!=NULL) {
struct hashlistnode<_Key,_Val> * next=bin->next;
- _free(bin);
+ delete bin;
bin=next;
}
}
search=search->next;
}
- struct hashlistnode<_Key,_Val> *newptr=(struct hashlistnode<_Key,_Val> *)_malloc(sizeof(struct hashlistnode<_Key,_Val>));
+ struct hashlistnode<_Key,_Val> *newptr=(struct hashlistnode<_Key,_Val> *)new struct hashlistnode<_Key,_Val>;
newptr->key=key;
newptr->val=val;
newptr->next=ptr;