Re: Example in Docs: GPOINTER_TO_INT



(gint) to_print

The example puts an int in the pointer "slot" instead of a pointer, by
casting it to the pointer type.  It then retrieves the number by casting
the pointer back to an int.

Maybe not the best example, but commonly used nonetheless.


I'm sorry  to take  this into a digression, why would we want to 
cast a pointer, which has a memory address stored in it, to an integer?

Ruben

Brooklyn Linux Solutions
http://www.mrbrklyn.com
http://www.brooklynonline.com

1-718-382-5752




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]