Re: [gtk-list] Re: dynamic creation of buttons



Peter Allen, dans le message (.gtk.general:1072), a écrit :
> Why is it different passing the macro GINT_TO_GPOINTER(button_num)
> which after the preprocessor has got its hands on it becomes
> (void *)buttons_num 
> different from &button_num, after all they point to the same thing.

No: (void *)buttons_num uses the _value_ of buttons_num as an address in
the memory, while &button_num _points_ to the place in memory where
button_num is actually stored. If you try to dereference the second,
that will work (except if it's a local variable that has been freed, but if
you dereference the first, you'll get daemons flying througs your nose. The
correct way tu use it is (int)user_data.



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