I have this code for matrix multiplication, using pthreads, but I get the error \"cast to pointer from integer of different size\"
I don\'t know what is wrong.I am n
You want to cast integer, short, or char and set a pointer to that value use the reinterpret_cast() call. We used to just (void*) the value and the older compilers were happy, but the new versions, for example g++ 4.8.5, know the value is not the right size for a pointer. reinterpret_cast is just like a cast but it resized it so the compile doesn't complain.
For example:
int i = 3;
pointer void * ptr;
ptr = (void*)i; // will generate the warning
ptr = reinterpret_cast(i); // No warning is generated
X11 example getting a character out of addr and then setting XTPOINTER to it.
val = (XTPOINTER)(*(char*)toVal.addr); // warning
val = reinterpret_cast(*(short*)toVal.addr); // No warning