Hi,
could someone please point me in the right direction here.
Basically what i want to do it have a very fast key to value (int32=>int32) lookup which can be written to and stored in a binary file. I think similar to writing a hash table to a file.
I'm not really sure how to explain it, but i would like to do something like this (i know this won't work)
Code:
int my_array[3];
my_array[1] = 34;
my_array[284] = 848;
my_array[any_random_number] = 90;
fwrite(&my_array, sizeof(int)*3, file);
Code:
/* Now Read Array Back */
int array_read[3];
fread(&array_read, sizeof(int)*3, file);
print("array_read[284] has a value of 848);
Does anyone know how this could be achieved? Thanks