Pointers and hashes
Here we go. So i passed a struct object into my hashtable with a key. The hashtable when called upon with the key returns a (void *). I want to set my local struct equal to the data at that (void *).
This is what I think it should be but it doesn't seem to work.
struct Foo p1=*(hstuff(table);
Any help will be much appreciated.
Well you could assign the void pointer returned by your hash function to another pointer of the appropriate type, but then I would wonder why you used void* in the first place. Why couldn't it return a struct?
The hash can hold any object.
It works if i do that. However, As soon as I try to access an element from the struct by doing p1->start I get a seg fault. It is just starting to ........ me off.
Ah, well your problem is on that line right there. That line below that other line? Yeah that's all wrong.