Glib hash table storing incorrect keys?

G_print ("Key: %u Value: %s\n", *key, value).

Argh! Yup, that was it. – August Flanagan Oct 17 at 17:12.

I.e. G_memdup(num_id, sizeof(num_id)) should be g_memdup(&num_id, sizeof(num_id)) It's a bit difficult to be sure since you don't show the type of num_id, but since that argument corresponds to the value stored in the table, it should be a pointer.It would make more sense to collect your key and value into a single struct, and insert those.

Sorry, num_id is a pointer, and the values of the table are correct. Only the keys are wrong. – August Flanagan Oct 17 at 15:09.

You are using uint32_t as a key and yet you declared g_hash_table_new(g_int64_hash, g_int64_equal) with 64-bit keys. Why don't you re-declare it as g_hash_table_new(g_int32_hash, g_int32_equal). If you still want to use it as is you would need to zero out all 64 bit of the key before copying a new value in it.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions