I need to combine an int with a void*. I was thinking of doing it like :
long int lint = ((int)integer<<(sizeof(void*)*8)) | ((void*)ptr);
but according to my previous message, a long int won’t suffice.
Can anyone suggest how to do this?
PS. Some people will ask why on earth I might want to do this. Well, I am developing a generic events system (dispatch/listen) that caters for countless different cases. I will post code when it’s ready…
Hmm shouldn’t it be something like:
Thit will still only work for 32 bit pointers and will not work for 64 bit. There is no built-in type that will fit such arithmetics.