test
This commit is contained in:
parent
a7124a9f87
commit
d89cb2ca05
9
map.c
9
map.c
|
@ -23,8 +23,8 @@ struct Bucket {
|
||||||
typedef struct Bucket Bucket;
|
typedef struct Bucket Bucket;
|
||||||
|
|
||||||
struct HashMap {
|
struct HashMap {
|
||||||
int (*HashFunction)(void *);
|
int (*HashFunction)(void *); //Function returning an integer as a hash
|
||||||
bool (*KeyCompare)(void *, void *);
|
bool (*KeyCompare)(void *, void *); //functiong returning true if two items are the smae
|
||||||
Bucket *buckets;
|
Bucket *buckets;
|
||||||
int size;
|
int size;
|
||||||
};
|
};
|
||||||
|
@ -116,8 +116,5 @@ int *AllocInt(int x) {
|
||||||
}
|
}
|
||||||
|
|
||||||
int main(){
|
int main(){
|
||||||
HashMap inttointhashmap = MakeHashMap(IntHash, IntToIntCmp, 2);
|
printf("test\n");
|
||||||
|
|
||||||
HashMapSet(&inttointhashmap, AllocInt(0), AllocInt(2));
|
|
||||||
HashMapSet(&inttointhashmap, AllocInt(1), AllocInt(100));
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue